The issues I had with uRequire:
-
line-endings issues (on my Mac)
→ npm install -g urequire … → urequire UMD lib -o dist env: node\r: No such file or directory
I resolved it with
dos2unix
:→ dos2unix /path/to/npm/lib/node_modules/urequire/build/code/uRequireCmd.js dos2unix: converting file /path/to/npm/lib/node_modules/urequire/build/code/uRequireCmd.js to Unix format ... → urequire UMD lib -o dist →
-
require
behavior is inconsistent with NodeJS (e.g the fix from your gist). Whilerequire('foo')
might be preferable torequire('foo.js')
, both work in NodeJS -
Would like to be able to pass a file, not ony a directory (e.g
urequire UMD index.js -o dist
vsurequire UMD lib -o dist
). In NodeJS, it's very common to have anindex.js
file which does the work required to create the module (even if that's justmodule.exports = require('./lib')
)