https://github.com/fongandrew/replace-loader
A simple Webpack loader that applies regular expression replacement to a file
https://github.com/fongandrew/replace-loader
Last synced: 23 days ago
JSON representation
A simple Webpack loader that applies regular expression replacement to a file
- Host: GitHub
- URL: https://github.com/fongandrew/replace-loader
- Owner: fongandrew
- License: mit
- Created: 2015-07-23T00:26:14.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-09-15T20:17:10.000Z (over 8 years ago)
- Last Synced: 2025-04-23T01:04:52.712Z (26 days ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# replace-loader
A simple Webpack loader that applies regular expression replacement to a fileSample config usage that replaces instances of "green" with "blue":
```javascript
module.exports = {
/* Other Stuff */
modules: {
loaders: [
{ test: /\.css$/,
loader: "style!css!replace?flags=g®ex=green&sub=blue" }
]
}
}
```Options
* regex - The regular expression. This string will be dropped as is into the
RegExp constructor, so make sure things are escaped properly.
* flags - Flags used to construct the regular expression
* sub - Replacement text