Answer the question
In order to leave comments, you need to log in
Webpack how to read cli options?
Greetings!
I am building the project through webpack, trying to get the cli parameters of the string that I pass during the build. 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'
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question