Skip to content

Replacing is wrong if values or regexps contain $ character. #5

@shackijj

Description

@shackijj

Hello!

I tried to use the plugin for replacing $$TEST$$ string in the code. The plugin didn't change anything.

Config example:

const ReplacePlugin = require('webpack-plugin-replace');
module.exports = {
  // ...
  plugins: [
    new ReplacePlugin({
      exclude: [
        'foo.js',
        /node_modules/,
        filepath => filepath.includes('ignore')
      ],
      values: {
        '$$TEST$$': 'FOO',
      }
    })
  ]
};

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