wr

webpack-replace

Replace loader for Webpack

Showing:

Popularity

Downloads/wk

191

GitHub Stars

3

Maintenance

Last Commit

6yrs ago

Contributors

3

Package

Dependencies

1

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Replace loader for Webpack

Perform replacements (plain and regular expression) in the contents loaded by the loader.

Install:

$ npm install --save-dev webpack-replace

Usage:

Add the loader to your webpack.config.js:

Single replacement:

module.exports = {
    // ...
    module: {
      loaders: [
        {
          test: /fileInWhichJQueryIsUndefined\.js$/,
          loader: 'webpack-replace',
          query: {
            search: 'jQuery',
            replace: 'window.$'
          }
        }
      ]
    }
}

Multiple replacements at once:

module.exports = {
    // ...
    module: {
      loaders: [
        {
          test: /\.js$/,
          loader: 'webpack-replace',
          query: {
            replace: [{
              from: 'jQuery',
              to: 'window.$'
            }]
          }
        }
      ]
    }
}

Contributing:

Feel free to open issues to propose stuff and participate. Pull requests are also welcome.

Licence:

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial