Hello,
I have a general configuration file which also includes urls for the client. I currently just do following to include it into a build.js
builder.build(funciton(err, res) {
if (err) throw err;
writeScript('window.config = ' + JSON.stringify(config) + res.require + res.js);
});
Unfortunately this is quite hacky and I would like to have something more like a native module I could require but I failed using something like this:
builder.hook('pre script', function(package) {
package.addFile('scripts', 'boot/config.js', 'module.exports = ' + JSON.stringify(config));
});
As I did not manage to access it in the boot namespace (root works strangely...)
What do you guys use to solve the problem? Is there a package available?
Best,
Bodo