Is there any way to pass an argument to the string-replace-loader ?
I try to achieve something like that -
Write in the shell - webpack arg1=HelloWorld
In the webpack.config.js -
var value = arg1 // get it from the shell
{
test: /testFile\.js$/,
loader: 'string-replace-loader',
options: {
search: '$',
replace: value,
}
}
And $ in testFile.js would become to be "HellowWorld".
How Could I get that ?
module.exports = function(env, argv) {.., tryargv.arg1 || 'defaultValue'(or env.arg1)