1.0.8 • Published 7 years ago

html-webpack-insert-plugin v1.0.8

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago

html-webpack-insert-plugin

Travis CI build status Dependency Status View on npm View on npm

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!

License

MIT © fudanfuhua

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago