Created
June 20, 2016 23:42
-
-
Save vladkosinov/263a5a0dbb05b7402ae528698596b769 to your computer and use it in GitHub Desktop.
usage example of html-webpack-plugin for stats building
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"js": [ | |
"js/common-16b95.js", | |
"js/app-26c95.js" | |
], | |
"css": [ | |
"css/common-902b1.css", | |
"css/app-82c1b.css" | |
] | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function htmlWebpackPluginEntry({ htmlWebpackPlugin }) { | |
const buildStats = { | |
js: htmlWebpackPlugin.files.js, | |
css: htmlWebpackPlugin.files.css | |
}; | |
return JSON.stringify(stats); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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