Add html-webpack-plugin-alter-chunks event
This commit is contained in:
parent
998ebf03eb
commit
c229fcbab2
|
|
@ -1,6 +1,10 @@
|
|||
Change History
|
||||
==============
|
||||
|
||||
v2.19.0
|
||||
----
|
||||
* Add `html-webpack-plugin-alter-chunks` event for custom chunk sorting and interpolation
|
||||
|
||||
v2.18.0
|
||||
----
|
||||
* Updated all dependencies
|
||||
|
|
|
|||
|
|
@ -244,11 +244,17 @@ Events
|
|||
|
||||
To allow other [plugins](https://github.com/webpack/docs/wiki/plugins) to alter the html this plugin executes the following events:
|
||||
|
||||
Asnyc:
|
||||
|
||||
* `html-webpack-plugin-before-html-generation`
|
||||
* `html-webpack-plugin-before-html-processing`
|
||||
* `html-webpack-plugin-after-html-processing`
|
||||
* `html-webpack-plugin-after-emit`
|
||||
|
||||
Sync:
|
||||
|
||||
* `html-webpack-plugin-alter-chunks`
|
||||
|
||||
Example implementation: [html-webpack-harddisk-plugin](https://github.com/jantimon/html-webpack-harddisk-plugin)
|
||||
|
||||
Usage:
|
||||
|
|
|
|||
2
index.js
2
index.js
|
|
@ -68,6 +68,8 @@ HtmlWebpackPlugin.prototype.apply = function (compiler) {
|
|||
var chunks = self.filterChunks(compilation.getStats().toJson(), self.options.chunks, self.options.excludeChunks);
|
||||
// Sort chunks
|
||||
chunks = self.sortChunks(chunks, self.options.chunksSortMode);
|
||||
// Let plugins alter the chunks and the chunk sorting
|
||||
chunks = compilation.applyPluginsWaterfall('html-webpack-plugin-alter-chunks', chunks, { plugin: self });
|
||||
// Get assets
|
||||
var assets = self.htmlWebpackPluginAssets(compilation, chunks);
|
||||
// If this is a hot update compilation, move on!
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "html-webpack-plugin",
|
||||
"version": "2.18.0",
|
||||
"version": "2.19.0",
|
||||
"description": "Simplifies creation of HTML files to serve your webpack bundles",
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
|
|
|
|||
Loading…
Reference in New Issue