html-webpack-plugin 4.5.1 → 4.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,8 +1,17 @@
1
- # Changelog
1
+ # Change Log
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- ### [4.5.1](https://github.com/jantimon/html-webpack-plugin/compare/v4.5.0...v4.5.1) (2021-01-03)
5
+ ## [4.5.2](https://github.com/jantimon/html-webpack-plugin/compare/v4.5.1...v4.5.2) (2021-02-18)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * more robust variable value extraction to add support for webpack >= 5.22.0 ([1aabaf9](https://github.com/jantimon/html-webpack-plugin/commit/1aabaf99820257cbe7d3efccb62b42254ad35e04))
11
+
12
+
13
+
14
+ ## [4.5.1](https://github.com/jantimon/html-webpack-plugin/compare/v4.5.0...v4.5.1) (2021-01-03)
6
15
 
7
16
 
8
17
  ### Bug Fixes
package/README.md CHANGED
@@ -88,6 +88,8 @@ The `html-webpack-plugin` provides [hooks](https://github.com/jantimon/html-webp
88
88
  * [csp-html-webpack-plugin](https://github.com/slackhq/csp-html-webpack-plugin) to add [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) meta tags to the HTML output
89
89
  * [webpack-nomodule-plugin](https://github.com/swimmadude66/webpack-nomodule-plugin) allows you to add a `nomodule` attribute to specific injected scripts, which prevents the scripts from being loaded by newer browsers. Good for limiting loads of polyfills.
90
90
  * [html-webpack-skip-assets-plugin](https://github.com/swimmadude66/html-webpack-skip-assets-plugin) Skip adding certain output files to the html file. Built as a drop-in replacement for [html-webpack-exclude-assets-plugin](https://www.npmjs.com/package/html-webpack-exclude-assets-plugin) and works with newer [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin) versions
91
+ * [html-webpack-inject-preload](https://github.com/principalstudio/html-webpack-inject-preload) allows to add preload links <link rel='preload'> anywhere you want.
92
+
91
93
 
92
94
 
93
95
  <h2 align="center">Usage</h2>
@@ -366,6 +368,7 @@ and the following options:
366
368
  ```js
367
369
  {
368
370
  collapseWhitespace: true,
371
+ keepClosingSlash: true,
369
372
  removeComments: true,
370
373
  removeRedundantAttributes: true,
371
374
  removeScriptTypeAttributes: true,
@@ -665,5 +668,5 @@ This project uses the [semistandard code style](https://github.com/Flet/semistan
665
668
  [deps]: https://david-dm.org/jantimon/html-webpack-plugin.svg
666
669
  [deps-url]: https://david-dm.org/jantimon/html-webpack-plugin
667
670
 
668
- [tests]: http://img.shields.io/travis/jantimon/html-webpack-plugin.svg
669
- [tests-url]: https://travis-ci.org/jantimon/html-webpack-plugin
671
+ [tests]: https://github.com/jantimon/html-webpack-plugin/workflows/CI/badge.svg
672
+ [tests-url]: https://github.com/jantimon/html-webpack-plugin/actions?query=workflow%3ACI
package/index.js CHANGED
@@ -316,8 +316,8 @@ class HtmlWebpackPlugin {
316
316
  return Promise.reject(new Error('The child compilation didn\'t provide a result'));
317
317
  }
318
318
  // The LibraryTemplatePlugin stores the template result in a local variable.
319
- // To extract the result during the evaluation this part has to be removed.
320
- source = source.replace('var HTML_WEBPACK_PLUGIN_RESULT =', '');
319
+ // Return the value from this variable
320
+ source += ';HTML_WEBPACK_PLUGIN_RESULT';
321
321
  const template = this.options.template.replace(/^.+!/, '').replace(/\?.+$/, '');
322
322
  const vmContext = vm.createContext(_.extend({ HTML_WEBPACK_PLUGIN: true, require: require, console: console }, global));
323
323
  const vmScript = new vm.Script(source, { filename: template });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "html-webpack-plugin",
3
- "version": "4.5.1",
3
+ "version": "4.5.2",
4
4
  "license": "MIT",
5
5
  "description": "Simplifies creation of HTML files to serve your webpack bundles",
6
6
  "author": "Jan Nicklas <j.nicklas@me.com> (https://github.com/jantimon)",