Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 679 Bytes

README.md

File metadata and controls

27 lines (22 loc) · 679 Bytes

plugin for html-webpack-plugin to extract resources from html page

install

npm install html-resource-webpack-plugin --save-dev

const HtmlWebpackPlugin = require('html-webpack-plugin')
const HtmlResourcePlugin = require('../index')

let webpackConfig = {
    // .....
    plugins: [
        new HtmlWebpackPlugin({
            filename: 'index2.html',
            template: path.resolve(pwd, "./test/te2/index2.html"),
            resourceName: {
                js: 'statics/[name]_[hash:6].[ext]',
                css: 'statics/[name]_[hash:6].[ext]'
            },
            chunks: ['index2']
        }),
        new HtmlResourcePlugin()
    ]
}