subconfig
Browserify transform to substitute config variables using underscore templates.
Installation
$ npm install subconfig
Note that you must also install config package:
$ npm install config
$ mkdir config
$ $EDITOR config/default.js
Usage
To be able to write in your client-side code, say, var socket = Primus('<%= ServerAddress %>')
, do
$ browserify -t subconfig app.js > bundle.js
To use custom prefix (<%= conf.ServerAddress %>
):
$ browserify -t [ subconfig -p conf ] app.js > bundle.js
or
$ browserify -t [ subconfig --prefix conf ] app.js > bundle.js
Export NODE_ENV=production
environment variable to switch to production config.
License
MIT