html-webpack-code-inject-plugin
v1.0.1
Published
Inject custom code in head or body.
Downloads
1
Maintainers
Readme
html-webpack-code-inject-plugin
Webpack config
const HtmlWebpackCodeInjectPlugin = require('html-webpack-code-inject-plugin').default;
module.exports = {
plugins: [
new HtmlWebpackPlugin({
// some config
}),
new HtmlWebpackCodeInjectPlugin({
headHtmlTagObjectList: [
{
tagName: "script",
innerHTML: `
window.onresize = function() {
console.log('test')
}
`
}
],
excludeFileCallback: (fileName) => fileName === 'test.html'
})
]
};
LICENSE
MIT