Monday 12 June 2017

How to pass params from one npm script into another one

Is it possible to run npm script with params from another npm script?

For instance:

"scripts": {
  "build": "node_modules/webpack/bin/webpack.js ", //should get params here
  "build:dev": "npm run build --env.type=dev"
  "build:prod": "npm run build --env.type=prod"
}

So, eventually params such as --env.type=dev should be passed to webpack.

P.S. I tried with $@ but with no luck

How to do that?



via Sergey Panfilov

No comments:

Post a Comment