Skip to content

Instantly share code, notes, and snippets.

@vladkosinov
Created June 20, 2016 23:42
Show Gist options
  • Save vladkosinov/263a5a0dbb05b7402ae528698596b769 to your computer and use it in GitHub Desktop.
Save vladkosinov/263a5a0dbb05b7402ae528698596b769 to your computer and use it in GitHub Desktop.
usage example of html-webpack-plugin for stats building
{
"js": [
"js/common-16b95.js",
"js/app-26c95.js"
],
"css": [
"css/common-902b1.css",
"css/app-82c1b.css"
]
}
module.exports = function htmlWebpackPluginEntry({ htmlWebpackPlugin }) {
const buildStats = {
js: htmlWebpackPlugin.files.js,
css: htmlWebpackPlugin.files.css
};
return JSON.stringify(stats);
};
const webpackConfig = {
// ...
plugins: [
// ...
new HtmlWebpackPlugin({
filename: 'build-stats.json',
template: path.resolve(__dirname, './render-stats.js'),
inject: false,
minify: false
})
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment