A gulp-replace-task port to webpack
npm install replace-task-webpack-plugin
To replace all @@foo
to bar
, and replace all /baz/
to bazbaz
.
// webpack.config.js
module.exports = {
// ... other configs
plugins: [
new ReplaceTaskWebpackPlugin({
patterns: [
{
match: 'foo',
replacement: 'bar'
},
{
match: /baz/g,
replacement: function(){
return 'bazbaz';
}
}
]
})
]
};
MIT