Add documentation for `html-webpack-plugin-alter-asset-tags`
This commit is contained in:
parent
c43bb4359f
commit
86badc3d6e
|
|
@ -1,6 +1,10 @@
|
|||
Change History
|
||||
==============
|
||||
|
||||
v2.21.0
|
||||
----
|
||||
* Add `html-webpack-plugin-alter-asset-tags` event to allow plugins to adjust the script/link tags
|
||||
|
||||
v2.20.0
|
||||
----
|
||||
* Exclude chunks works now even if combined with dependency sort
|
||||
|
|
|
|||
|
|
@ -248,6 +248,7 @@ Asnyc:
|
|||
|
||||
* `html-webpack-plugin-before-html-generation`
|
||||
* `html-webpack-plugin-before-html-processing`
|
||||
* `html-webpack-plugin-alter-asset-tags`
|
||||
* `html-webpack-plugin-after-html-processing`
|
||||
* `html-webpack-plugin-after-emit`
|
||||
|
||||
|
|
|
|||
4
index.js
4
index.js
|
|
@ -145,7 +145,7 @@ HtmlWebpackPlugin.prototype.apply = function (compiler) {
|
|||
.then(function (html) {
|
||||
// Prepare script and link tags
|
||||
var assetTags = self.generateAssetTags(assets);
|
||||
var pluginArgs = {head: assetTags.head, body: assetTags.body, plugin: self, outputName: self.childCompilationOutputName};
|
||||
var pluginArgs = {head: assetTags.head, body: assetTags.body, plugin: self, chunks: chunks, outputName: self.childCompilationOutputName};
|
||||
// Allow plugins to change the assetTag definitions
|
||||
return applyPluginsAsyncWaterfall('html-webpack-plugin-alter-asset-tags', pluginArgs)
|
||||
.then(function () {
|
||||
|
|
@ -456,7 +456,7 @@ HtmlWebpackPlugin.prototype.htmlWebpackPluginAssets = function (compilation, chu
|
|||
/**
|
||||
* Injects the assets into the given html string
|
||||
*/
|
||||
HtmlWebpackPlugin.prototype.generateAssetTags = function (assets, applyPluginsAsyncWaterfall) {
|
||||
HtmlWebpackPlugin.prototype.generateAssetTags = function (assets) {
|
||||
// Turn script files into script tags
|
||||
var scripts = assets.js.map(function (scriptPath) {
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "html-webpack-plugin",
|
||||
"version": "2.20.0",
|
||||
"version": "2.21.0",
|
||||
"description": "Simplifies creation of HTML files to serve your webpack bundles",
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ var HtmlWebpackPlugin = require('../index.js');
|
|||
|
||||
var OUTPUT_DIR = path.join(__dirname, '../dist');
|
||||
|
||||
jasmine.getEnv().defaultTimeoutInterval = 10000;
|
||||
jasmine.getEnv().defaultTimeoutInterval = 30000;
|
||||
|
||||
function testHtmlPlugin (webpackConfig, expectedResults, outputFile, done, expectErrors, expectWarnings) {
|
||||
outputFile = outputFile || 'index.html';
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ var HtmlWebpackPlugin = require('../index.js');
|
|||
|
||||
var OUTPUT_DIR = path.join(__dirname, '../dist');
|
||||
|
||||
jasmine.getEnv().defaultTimeoutInterval = 10000;
|
||||
jasmine.getEnv().defaultTimeoutInterval = 30000;
|
||||
|
||||
function setUpCompiler (htmlWebpackPlugin) {
|
||||
spyOn(htmlWebpackPlugin, 'evaluateCompilationResult').and.callThrough();
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ var webpackMajorVersion = require('webpack/package.json').version.split('.')[0];
|
|||
|
||||
var OUTPUT_DIR = path.join(__dirname, '../dist');
|
||||
|
||||
jasmine.getEnv().defaultTimeoutInterval = 10000;
|
||||
jasmine.getEnv().defaultTimeoutInterval = 30000;
|
||||
|
||||
function runExample (exampleName, done) {
|
||||
var examplePath = path.resolve(__dirname, '..', 'examples', exampleName);
|
||||
|
|
|
|||
Loading…
Reference in New Issue