html-webpack-replace-assets-plugin
v1.0.6
Published
change assets path when html-webpack-plugin generate assets
Downloads
25
Readme
html-webpack-replace-assets-plugin
A plugin to help webpack concat js and inject into html
Why
Webpack is really powerful. However, when I want to change the asset files and inject into html without webpack JSONP code wrapper, it seems impossible to do that without other tool's help.
Install
npm install html-webpack-replace-assets-plugin --save-dev
Features
- replace assets path when inject to html(with html-webpack-plugin)
Usage
const HtmlWebpackReplaceAssetsPlugin = require('html-webpack-replace-assets-plugin');
new HtmlWebpackReplaceAssetsPlugin({
...see options
// examples
convert(asset, path) {
// asset: webpack asset object
// path: asset path
return path.replace('.js', `${asset.size()}.js.gz`);
}
});
Options
convert [Function] default: (asset, path) => name
assets path(or name) transformer
TODO
- [ ] add css support