Skip to content

Webpack 4 - Replace values inside json file #68

Description

@stephanbehm

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions