I have in my package.json the following
"scripts": {
...
"prod": "gulp build --production && webpack --env.config=production"
}
I now want to pass a parameter "theme" to both gulp and webpack to be able to adjust the output of the build process from the command line.
I figured out how to pass it to webpack: npm run prod -- --env.theme=themename
but gulp does not take care of this. I also played around with the yargs
-package, processs.argv
and bash string substitution by changing the npm script to "gulp build --production \"$1\" && webpack --env.config=production"
but that did not work out either.
How can this be achieved? What am I missing? Any hints highly appreciated!