Remove parts of html emitted by the html-webpack-plugin using a regular expression
npm install html-webpack-plugin-remove
Remove parts of html emitted by the html-webpack-plugin using a regular expression.
The plugin hooks into events emitted by the html-webpack-plugin and simply replaces the parts that match a passed in regular expression.
bash
npm i html-webpack-plugin-remove --save-dev
`$3
`js
const HtmlPlugin = require('html-webpack-plugin')
const HtmlPluginRemove = require('html-webpack-plugin-remove')module.exports = {
/ ... /
plugins: [
new HtmlPlugin(/ ... /),
new HtmlPluginRemove(/?src="style\..?\.js".*?<\/script>/)
]
}
``