content-replace-webpack-plugin
simple and efficient plugin that replace assets content when webpack emit files
Install
npm install content-replace-webpack-plugin --save--dev
Usage
add plugin in your webpack.config.js
var ContentReplacePlugin = moduleexports = entry: index:"./index.js" module: loaders: ... output: path:'./dist' filename:'[name].min.js' plugins: external: 'path/to/other/file' // other files which not in webpack assets chunks: 'index' rules: content
Plugin Options
- external: other files which not in webpack assets
- rules: replace rules, accept object which key is file extname and value is replace function
- chunks: only these chunks's files will be replaced, default value is all