Skip to content

Instantly share code, notes, and snippets.

@jfsiii
Created October 17, 2012 00:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfsiii/3902899 to your computer and use it in GitHub Desktop.
Save jfsiii/3902899 to your computer and use it in GitHub Desktop.
Quick notes on uRequire

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). While require('foo') might be preferable to require('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 vs urequire UMD lib -o dist). In NodeJS, it's very common to have an index.js file which does the work required to create the module (even if that's just module.exports = require('./lib'))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment