Webpack how to read cli parameters?
-
Hello!
I am building a project through webpack, trying to get the cli parameters of the line that I pass during the build. I'm using the yargs module guide https://www.npmjs.com/package/yargs :
const {argv} = require('yargs'); console.log(argv);
$ npm run start --test = 4
{ _: [], cache: null, bail: null, profile: null, color: { level: 3, hasBasic: true, has256: true, has16m: true }, colors: { level: 3, hasBasic: true, has256: true, has16m: true }, liveReload: true, 'live-reload': true, serveIndex: true, 'serve-index': true, inline: true, info: true, mode: 'development', 'info-verbosity': 'info', infoVerbosity: 'info', 'client-log-level': 'info', clientLogLevel: 'info', host: 'localhost', '$0': 'node_modules\\webpack-dev-server\\bin\\webpack-dev-server.js' }
The parameter I passed was not found, what should I do?JavaScript Arabella Cobb, Oct 5, 2019 -
And so:
npm run start - -test = 4
Anonymous
1 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!