The npm command passes parameters to the webpack configuration file

how do I use the npm command to run script, in webpack on the command line to pass parameters to the webpack configuration file on the command line? At present, we know a way to pass npm run create-app=test-router=1-store=1, but it is too troublesome, is there any simple way to pass parameters?

in package.json

"scripts": {
    "create": "cross-env NODE_ENV=development node ./build/generate.js --app --store --router"
},

Command Line npm

npm run create  
Feb.24,2022

as far as I know, not anymore. If it really doesn't work, configure a few more commonly used npm script commands according to your usage, and that's how npm is passed.

Menu