This support all replace html operates in webpack by string or regexp.
$ npm install --save html-replace-all-webpack-plugin
new HtmlReplaceWebpackPlugin({
matches: [{
match: /<body>/,
value: `<body>hello World!`,
}]
})
new HtmlReplaceWebpackPlugin({
matches: [{
matchStart: /<body>/,
matchEnd: /<\/body>/,
value: `<body>hello World!</body>`,
}]
})
new HtmlReplaceWebpackPlugin({
matchObjects: [{
prefix: '${',
suffix: '}',
target: {
title: 'Test matchObject',
content: 'hello World!'
}
}]
})