https://github.com/fudanfuhua/html-webpack-insert-plugin
use webpack to issert js or css to html templete
https://github.com/fudanfuhua/html-webpack-insert-plugin
assets insert insertion-sort webpack
Last synced: 10 months ago
JSON representation
use webpack to issert js or css to html templete
- Host: GitHub
- URL: https://github.com/fudanfuhua/html-webpack-insert-plugin
- Owner: fudanfuhua
- License: mit
- Created: 2017-09-17T05:50:07.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-21T13:08:03.000Z (over 8 years ago)
- Last Synced: 2025-02-05T08:16:17.223Z (11 months ago)
- Topics: assets, insert, insertion-sort, webpack
- Language: JavaScript
- Size: 6.84 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# html-webpack-insert-plugin
[](https://travis-ci.org/danawoodman/react-fontawesome)
[](https://david-dm.org/danawoodman/react-fontawesome)
[](https://www.npmjs.com/package/react-fontawesome)
[](https://www.npmjs.com/package/react-fontawesome)
> 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
```js
const HtmlWebpackInsertPlugin = require('html-webpack-insert-plugin');
plugins: [
new HtmlWebpackPlugin({
...
}),
new HtmlWebpackInsertPlugin({
paths: {
js: [...],
css: [...]
}
})
]
```
## Examples
```js
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!
## License
[MIT](license) © [fudanfuhua][author]
[author]: https://github.com/fudanfuhua