Webpack 4 - Replace values inside json file
stephanbehm opened this issue · 1 comments
stephanbehm commented
Hello everyone,
I am using Webpack 4.46.0 with "string-replace-loader" 2.3.0.
I am not able to replace any strings in my *.json files. I have various "app.json" files in different folders - therefore I want to replace some values inside.
Config:
module: {
rules: [
{
test: /app\.json$/,
loader: 'string-replace-loader',
options: {
multiple: [
{ search: './data_a', replace: '../../data_a', flags: 'g'},
{ search: './data_b', replace: '../../data_b', flags: 'g' },
],
},
},
Any ideas what I am doing wrong?
Stebeber commented
rules: [
{
test: /\.json$/,
loader: 'string-replace-loader',
options: {
search: './data',
replace: '../../data',
flags: 'g',
strict: true,
},
},
Using strict mode fails - so it seems to me that the files are not found. Any ideas?