html-webpack-insert-plugin
v1.0.8
Published
issert js,css to html templete
Downloads
4
Readme
html-webpack-insert-plugin
use "html-webpack-insert-plugin" to issert js or css to html templete, must work in with "html-webpack-plugin".
Install
npm install --save-dev html-webpack-insert-plugin
Usage
const HtmlWebpackInsertPlugin = require('html-webpack-insert-plugin');
plugins: [
new HtmlWebpackPlugin({
...
}),
new HtmlWebpackInsertPlugin({
paths: {
js: [...],
css: [...]
}
})
]
Examples
const HtmlWebpackInsertPlugin = require('html-webpack-insert-plugin');
plugins: [
new HtmlWebpackPlugin({
title: 'bundle1',
template: path.join(__dirname, 'src/template', 'index.html');,
inject: 'body',
filename: path.join(__dirname, 'tmp', 'index.html')
}),
new HtmlWebpackInsertPlugin({
paths: {
js: [
"/asset/layer-mobile/layer.js",
"/asset/js/zepto/zepto.min.js",
"/asset/js/sm/sm.js",
"/asset/js/sm/sm-city-picker.min.js",
"/asset/js/fastclick/fastclick.min.js"
],
css: [
"/asset/css/font-awesome/css/font-awesome.min.css",
"/asset/layer-mobile/need/layer.css",
"/asset/css/citypicker.css",
"https://wq.koko.com/promote/css/works.css"
]
}
})
]
Contributing
Pull requests welcome!