Manipulating process.env from package-scrips.js
When putting something like process.env.hello = 'hi' in the package-scripts.js file, you get hello=hi in the spawned environment.
To me, that is a very nice feature, because I can provide helper vars to scripts, while the commands stay somewhat readable, e.g.
process.env.defDebug = '*,-babel,-something,-other'
if (!process.env.NODE_ENV) process.env.NODE_ENV = 'development'
module.exports = {scripts: {default: `\${DEBUG:-$defDebug} node script.js`}}
This will provide the default settings to DEBUG if it's not defined, and enforce NODE_ENV=development unless specified.
I'd like this feature to remain always; I can add it to the documentation if you like, but I have no idea how to write a test for it. I had a look at the tests but couldn't figure it out quickly.
@wmertens So this issue is to say that this current feature simply needs documentation? I can write a test for it. If you're willing to document it, that would be great.
Yes indeed :)