script-ext-inline-html-webpack-plugin
v1.0.0
Published
Enhances html-webpack-plugin functionality with append or prepend custom inline script tag
Downloads
7
Maintainers
Readme
Installation
You must be running webpack (1.x or 2.x) )on node 4+.
Install the plugin with npm:
$ npm install --save-dev script-ext-inline-html-webpack-plugin
Basic Usage
Add the plugin to your webpack config as follows:
const ScriptExtInlineHtmlWebpackPlugin = require('script-ext-inline-html-webpack-plugin');
plugins: [
new HtmlWebpackPlugin(),
new ScriptExtInlineHtmlWebpackPlugin({
append: `
(function() {
console.log('hello world');
}());
`
})
]
will append inline <script>
tag with given content into generated body of html.
very simple and easy...
Preppend
const ScriptExtInlineHtmlWebpackPlugin = require('script-ext-inline-html-webpack-plugin');
plugins: [
new HtmlWebpackPlugin(),
new ScriptExtInlineHtmlWebpackPlugin({
prepend: `
(function() {
console.log('hello world');
}());
`
})
]