I have a scenario where I have to run three npm script to achieve some result in my application. I combined them in one npm script. This is my package.json
:
"scripts": {
"setup": "npm install && npm run some-script && npm install",
"some-script": "gulp some-other-script"
}
what I would like to do is to pass arguments to setup
script from command line which will be passed further to the some-script
script.
If I run npm run script -- --abc=123
the arguments are added at the end of the script but I would like to pass it to specific script (in this case to npm run some-script
). I also tried to rewrite script definition like this:
"setup": "npm install && npm run some-script -- --sample=sample&& npm install"
but with no luck.
I'm aware of shell functions (described here: Sending command line arguments to npm script and here https://github.com/npm/npm/issues/9627) but I need a solution which will work cross-platform.
Is there a way to do that?