rootrequire would not work with browserify, right?
What about a special app/node_modules/config.js module, that deals with everything that has to be required using a relative paths?
// app/node_modules/lib/config.js
module.exports = {
package: require('../../package.json'),
// add other stuff if necessary
};
Then use a browserify transform like require-key in order to save some bits and bytes in case not all the content of config.js is used inside the app.
If I need information from package.json my file might include:
var version = require('lib/config').package.version;
// ...
Using that technique, "rootrequire" might not be necessary anymore and could be removed in readme.md and as a dependency from the project.
rootrequire would not work with browserify, right?
What about a special
app/node_modules/config.js
module, that deals with everything that has to be required using a relative paths?Then use a browserify transform like require-key in order to save some bits and bytes in case not all the content of
config.js
is used inside the app. If I need information frompackage.json
my file might include:Using that technique, "rootrequire" might not be necessary anymore and could be removed in
readme.md
and as a dependency from the project.