Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

html-webpack-plugin

Package Overview
Dependencies
Maintainers
2
Versions
141
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-webpack-plugin - npm Package Compare versions

Comparing version 2.23.0 to 2.24.0

6

CHANGELOG.md
Change History
==============
v2.24.0
---
* Update dependencies
* Add deprecate warning for plugins not returning a result
* Add [path] for favicons
v2.23.0

@@ -5,0 +11,0 @@ ---

46

index.js

@@ -66,3 +66,3 @@ 'use strict';

compiler.plugin('emit', function (compilation, callback) {
var applyPluginsAsyncWaterfall = Promise.promisify(compilation.applyPluginsAsyncWaterfall, {context: compilation});
var applyPluginsAsyncWaterfall = self.applyPluginsAsyncWaterfall(compilation);
// Get all chunks

@@ -97,3 +97,3 @@ var chunks = self.filterChunks(compilation.getStats().toJson(), self.options.chunks, self.options.excludeChunks);

.then(function (faviconBasename) {
var publicPath = compilation.options.output.publicPath || '';
var publicPath = compilation.mainTemplate.getPublicPath({hash: compilation.hash}) || '';
if (publicPath && publicPath.substr(-1) !== '/') {

@@ -142,8 +142,8 @@ publicPath += '/';

var pluginArgs = {html: html, assets: assets, plugin: self, outputName: self.childCompilationOutputName};
return applyPluginsAsyncWaterfall('html-webpack-plugin-before-html-processing', pluginArgs)
.then(function () {
return pluginArgs.html;
});
return applyPluginsAsyncWaterfall('html-webpack-plugin-before-html-processing', pluginArgs);
})
.then(function (html) {
.then(function (result) {
var html = result.html;
var assets = result.assets;
var chunks = result.chunks;
// Prepare script and link tags

@@ -154,13 +154,18 @@ var assetTags = self.generateAssetTags(assets);

return applyPluginsAsyncWaterfall('html-webpack-plugin-alter-asset-tags', pluginArgs)
.then(function () {
.then(function (result) {
// Add the stylesheets, scripts and so on to the resulting html
return self.postProcessHtml(html, assets, { body: pluginArgs.body, head: pluginArgs.head });
return self.postProcessHtml(html, assets, { body: result.body, head: result.head })
.then(function (html) {
return _.extend(result, {html: html, assets: assets});
});
});
})
// Allow plugins to change the html after assets are injected
.then(function (html) {
.then(function (result) {
var html = result.html;
var assets = result.assets;
var pluginArgs = {html: html, assets: assets, plugin: self, outputName: self.childCompilationOutputName};
return applyPluginsAsyncWaterfall('html-webpack-plugin-after-html-processing', pluginArgs)
.then(function () {
return pluginArgs.html;
.then(function (result) {
return result.html;
});

@@ -619,2 +624,19 @@ })

/**
* Helper to promisify compilation.applyPluginsAsyncWaterfall that returns
* a function that helps to merge given plugin arguments with processed ones
*/
HtmlWebpackPlugin.prototype.applyPluginsAsyncWaterfall = function (compilation) {
var promisedApplyPluginsAsyncWaterfall = Promise.promisify(compilation.applyPluginsAsyncWaterfall, {context: compilation});
return function (eventName, pluginArgs) {
return promisedApplyPluginsAsyncWaterfall(eventName, pluginArgs)
.then(function (result) {
if (!result) {
compilation.warnings.push(new Error('Using html-webpack-plugin-after-html-processing without returning a result is deprecated.'));
}
return _.extend(pluginArgs, result);
});
};
};
module.exports = HtmlWebpackPlugin;
{
"name": "html-webpack-plugin",
"version": "2.23.0",
"version": "2.24.0",
"description": "Simplifies creation of HTML files to serve your webpack bundles",

@@ -40,30 +40,30 @@ "main": "index.js",

"appcache-webpack-plugin": "^1.3.0",
"css-loader": "^0.23.1",
"dir-compare": "1.0.1",
"es6-promise": "^3.2.1",
"css-loader": "^0.25.0",
"dir-compare": "1.2.0",
"es6-promise": "^4.0.5",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.9.0",
"html-loader": "^0.4.3",
"html-loader": "^0.4.4",
"jade": "^1.11.0",
"jade-loader": "^0.8.0",
"jasmine": "^2.4.1",
"jasmine": "^2.5.2",
"rimraf": "^2.5.4",
"semistandard": "^8.0.0",
"semistandard": "8.0.0",
"style-loader": "^0.13.1",
"underscore-template-loader": "^0.7.3",
"url-loader": "^0.5.7",
"webpack": "^1.13.1",
"webpack": "^1.13.2",
"webpack-recompilation-simulator": "^1.3.0"
},
"dependencies": {
"bluebird": "^3.4.1",
"html-minifier": "^3.0.2",
"loader-utils": "^0.2.15",
"lodash": "^4.14.2",
"pretty-error": "^2.0.0",
"bluebird": "^3.4.6",
"html-minifier": "^3.1.0",
"loader-utils": "^0.2.16",
"lodash": "^4.16.4",
"pretty-error": "^2.0.2",
"toposort": "^1.0.0"
},
"peerDependencies": {
"webpack": "*"
"webpack": "1 || ^2.1.0-beta"
}
}

@@ -65,3 +65,3 @@ HTML Webpack Plugin

If you have any css assets in webpack's output (for example, css extracted
If you have any CSS assets in webpack's output (for example, CSS extracted
with the [ExtractTextPlugin](https://github.com/webpack/extract-text-webpack-plugin))

@@ -83,3 +83,3 @@ then these will be included with `<link>` tags in the HTML head.

- `hash`: `true | false` if `true` then append a unique webpack compilation hash to all
included scripts and css files. This is useful for cache busting.
included scripts and CSS files. This is useful for cache busting.
- `cache`: `true | false` if `true` (default) try to emit the file only if it was changed.

@@ -140,4 +140,4 @@ - `showErrors`: `true | false` if `true` (default) errors details will be written into the html page.

If the default generated HTML doesn't meet your needs you can supply
your own template. The easiest way is to use the `inject` option and pass a custom html file.
The html-webpack-plugin will automatically inject all necessary css, js, manifest
your own template. The easiest way is to use the `template` option and pass a custom html file.
The html-webpack-plugin will automatically inject all necessary CSS, JS, manifest
and favicon files into the markup.

@@ -144,0 +144,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc