Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jantimon/html-webpack-plugin
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 298635f4b3fb19fe920b1e0b982b61af0f31239d
Choose a base ref
...
head repository: jantimon/html-webpack-plugin
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 873d75bbcbd28ef7dff0a1549d3e442119e278d3
Choose a head ref

Commits on Dec 13, 2018

  1. chore: Release 4.0.0-beta.5

    jantimon committed Dec 13, 2018
    Copy the full SHA
    342c4e8 View commit details

Commits on Jan 11, 2019

  1. feat: Add typings to package.json

    See #1132
    wingrunr21 authored and jantimon committed Jan 11, 2019
    Copy the full SHA
    a524e8f View commit details

Commits on Feb 3, 2019

  1. Copy the full SHA
    56037a6 View commit details
  2. Copy the full SHA
    267e0e0 View commit details

Commits on Feb 16, 2019

  1. fix: Repair typings (#1166)

    jantimon authored Feb 16, 2019
    Copy the full SHA
    f4cb241 View commit details

Commits on Feb 17, 2019

  1. feat: Add support for <base> tag (#1160)

    atstp authored and jantimon committed Feb 17, 2019
    Copy the full SHA
    c5d4b86 View commit details
  2. Copy the full SHA
    d4eb1c7 View commit details

Commits on Mar 22, 2019

  1. fix: Use src/index.ejs by default if present (#1167)

    BREAKING CHANGE: Use src/index.ejs if no template option is set.
    jantimon authored Mar 22, 2019
    Copy the full SHA
    c27e5e4 View commit details

Commits on Mar 28, 2019

  1. Copy the full SHA
    2546551 View commit details

Commits on May 4, 2019

  1. chore: Update dependencies

    AviVahl authored and jantimon committed May 4, 2019
    Copy the full SHA
    38db64a View commit details

Commits on May 12, 2019

  1. added package for supporting issue #1158

    - #1158
    
    This package solves 
    #381, #818, #667, #624
    thearchitgarg authored and jantimon committed May 12, 2019
    Copy the full SHA
    8b9fb70 View commit details
  2. Added link and description for nomodule-plugin

    Created a new plugin to help limit executed file size.
    Adam Yost authored and jantimon committed May 12, 2019
    Copy the full SHA
    c02def8 View commit details
  3. renamed plugin

    Adam Yost authored and jantimon committed May 12, 2019
    Copy the full SHA
    7fa6aa8 View commit details
  4. Copy the full SHA
    17fbb30 View commit details

Commits on May 22, 2019

  1. Example README.md

    TroyTae authored and jantimon committed May 22, 2019
    Copy the full SHA
    895db29 View commit details

Commits on Jul 7, 2019

  1. Copy the full SHA
    a2a259a View commit details
  2. Fix migration.md

    Fix migration.md by adding `module.rules` rather than `module.loaders` and `pug-loader` rather than just `pug`.
    AhmedElaguab authored and jantimon committed Jul 7, 2019
    Copy the full SHA
    a18f809 View commit details

Commits on Jul 9, 2019

  1. Fix tiny typo

    Hey noticed a tiny typo in the comment.
    "as aminimalistic loader" => "as a minimalistic loader"
    adamsanderson authored and jantimon committed Jul 9, 2019
    Copy the full SHA
    0217b04 View commit details
  2. Update README.md

    hg-pyun authored and jantimon committed Jul 9, 2019
    Copy the full SHA
    d1bcd95 View commit details
  3. Copy the full SHA
    7f21910 View commit details
  4. chore: Adjust speed limit

    jantimon committed Jul 9, 2019
    Copy the full SHA
    5acac51 View commit details

Commits on Jul 16, 2019

  1. Copy the full SHA
    8b7255f View commit details

Commits on Jul 18, 2019

  1. fix: Add typing for assets(Close #1243)

    Austaras authored and jantimon committed Jul 18, 2019
    Copy the full SHA
    9fef060 View commit details
  2. Copy the full SHA
    62890be View commit details
  3. chore: publish 4.0.0-beta.8

    jantimon committed Jul 18, 2019
    Copy the full SHA
    075473d View commit details

Commits on Jul 23, 2019

  1. 1
    Copy the full SHA
    34d8aa5 View commit details

Commits on Aug 7, 2019

  1. Copy the full SHA
    35a1541 View commit details

Commits on Sep 9, 2019

  1. Copy the full SHA
    6de319b View commit details

Commits on Sep 24, 2019

  1. Fix README typo

    Had "inside.ejs" instead of "index.ejs"
    ttous authored and jantimon committed Sep 24, 2019
    Copy the full SHA
    655cbcd View commit details

Commits on Nov 11, 2019

  1. Copy the full SHA
    c66766c View commit details
  2. chore: Release 4.0.0-beta.9

    jantimon committed Nov 11, 2019
    Copy the full SHA
    2595a79 View commit details
  3. Copy the full SHA
    a2ad30a View commit details
  4. chore: Release 4.0.0-beta.10

    jantimon committed Nov 11, 2019
    Copy the full SHA
    f4eafdc View commit details
  5. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    24bf1b5 View commit details
  6. Copy the full SHA
    de22fc2 View commit details
  7. Copy the full SHA
    2549557 View commit details
  8. chore: Release 4.0.0-beta.11

    jantimon committed Nov 11, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    bf017f3 View commit details

Commits on Jan 2, 2020

  1. Copy the full SHA
    40b410e View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a195c34 View commit details

Commits on Jan 28, 2020

  1. Fix broken links in examples

    hrs-o authored and jantimon committed Jan 28, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    096a760 View commit details

Commits on Feb 6, 2020

  1. Fix typo in template option docts

    of -> on
    tomquirk authored and jantimon committed Feb 6, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    dfb98e7 View commit details

Commits on Mar 17, 2020

  1. Copy the full SHA
    1d66e53 View commit details
  2. Copy the full SHA
    7df269f View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    de315eb View commit details
  4. Copy the full SHA
    e448b5d View commit details
  5. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e97ce17 View commit details
  6. Copy the full SHA
    97f9fb9 View commit details

Commits on Mar 18, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a1a37cf View commit details

Commits on Mar 21, 2020

  1. Add typing for getHooks

    chenxsan authored and jantimon committed Mar 21, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    42a6d4a View commit details

Commits on Mar 23, 2020

  1. chore(release): 4.0.0

    jantimon committed Mar 23, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    eb73905 View commit details
Showing with 6,092 additions and 4,694 deletions.
  1. +12 −0 .github/FUNDING.yml
  2. +25 −52 .github/ISSUE_TEMPLATE/bug_report.md
  3. +37 −0 .github/workflows/main.yml
  4. +1 −0 .gitignore
  5. +1 −1 .node-version
  6. +0 −11 .travis.yml
  7. +296 −1 CHANGELOG.md
  8. +147 −77 README.md
  9. +0 −23 appveyor.yml
  10. +10 −9 docs/template-option.md
  11. +19 −0 examples/README.md
  12. +0 −104 examples/appcache/dist/webpack-4/bundle.js
  13. +0 −1 examples/appcache/dist/webpack-4/index.html
  14. +0 −9 examples/appcache/dist/webpack-4/manifest.appcache
  15. +0 −34 examples/appcache/webpack.config.js
  16. +1 −1 examples/build-examples.js
  17. +0 −1 examples/chunk-optimization/dist/webpack-4/entryA.html
  18. +0 −170 examples/chunk-optimization/dist/webpack-4/entryA.js
  19. +0 −43 examples/chunk-optimization/dist/webpack-4/entryA~entryB.js
  20. +0 −1 examples/chunk-optimization/dist/webpack-4/entryB.html
  21. +0 −169 examples/chunk-optimization/dist/webpack-4/entryB.js
  22. +0 −1 examples/chunk-optimization/dist/webpack-4/entryC.html
  23. +0 −13 examples/chunk-optimization/dist/webpack-4/libText.js
  24. +0 −585 examples/chunk-optimization/dist/webpack-4/vendors~entryA~entryB.js
  25. +352 −0 examples/chunk-optimization/dist/webpack-5/219.js
  26. +50 −0 examples/chunk-optimization/dist/webpack-5/965.js
  27. +1 −0 examples/chunk-optimization/dist/webpack-5/entryA.html
  28. +184 −0 examples/chunk-optimization/dist/webpack-5/entryA.js
  29. +1 −0 examples/chunk-optimization/dist/webpack-5/entryB.html
  30. +183 −0 examples/chunk-optimization/dist/webpack-5/entryB.js
  31. +1 −0 examples/chunk-optimization/dist/webpack-5/entryC.html
  32. +6 −6 examples/chunk-optimization/dist/{webpack-4 → webpack-5}/libMath.js
  33. +13 −0 examples/chunk-optimization/dist/webpack-5/libText.js
  34. +3 −3 examples/chunk-optimization/webpack.config.js
  35. +8 −0 examples/custom-insertion-position/dist/webpack-5/bundle.js
  36. +12 −0 examples/custom-insertion-position/dist/webpack-5/index.html
  37. +3 −0 examples/custom-insertion-position/example.js
  38. +12 −0 examples/custom-insertion-position/index.ejs
  39. +24 −0 examples/custom-insertion-position/readme.md
  40. +25 −0 examples/custom-insertion-position/webpack.config.js
  41. +0 −104 examples/custom-template/dist/webpack-4/bundle.js
  42. +0 −1 examples/custom-template/dist/webpack-4/index.html
  43. BIN ...4/0714810ae3fb211173e2964249507195.png → custom-template/dist/webpack-5/55b19870aff2e53d1fb1.png}
  44. +63 −0 examples/custom-template/dist/webpack-5/bundle.js
  45. +1 −0 examples/custom-template/dist/webpack-5/index.html
  46. 0 examples/{appcache/dist/webpack-4 → custom-template/dist/webpack-5}/styles.css
  47. +1 −1 examples/custom-template/readme.md
  48. +1 −1 examples/custom-template/template.html
  49. +1 −1 examples/custom-template/webpack.config.js
  50. +0 −718 examples/default/dist/webpack-4/bundle.js
  51. +478 −0 examples/default/dist/webpack-5/bundle.js
  52. +1 −1 examples/default/dist/{webpack-4 → webpack-5}/index.html
  53. +2 −2 examples/default/webpack.config.js
  54. +0 −104 examples/favicon/dist/webpack-4/bundle.js
  55. +0 −1 examples/favicon/dist/webpack-4/favicon.html
  56. +63 −0 examples/favicon/dist/webpack-5/bundle.js
  57. +1 −0 examples/favicon/dist/webpack-5/favicon.html
  58. BIN examples/favicon/dist/{webpack-4 → webpack-5}/favicon.ico
  59. 0 examples/{custom-template/dist/webpack-4 → favicon/dist/webpack-5}/styles.css
  60. +1 −1 examples/favicon/webpack.config.js
  61. +0 −1 examples/html-loader/dist/webpack-4/about.html
  62. +0 −104 examples/html-loader/dist/webpack-4/bundle.js
  63. +0 −1 examples/html-loader/dist/webpack-4/index.html
  64. BIN examples/{appcache/logo.png → html-loader/dist/webpack-5/55b19870aff2e53d1fb1.png}
  65. +1 −0 examples/html-loader/dist/webpack-5/about.html
  66. +63 −0 examples/html-loader/dist/webpack-5/bundle.js
  67. BIN examples/html-loader/dist/{webpack-4 → webpack-5}/favicon.ico
  68. +1 −0 examples/html-loader/dist/webpack-5/index.html
  69. 0 examples/{favicon/dist/webpack-4 → html-loader/dist/webpack-5}/styles.css
  70. +1 −1 examples/html-loader/webpack.config.js
  71. +0 −105 examples/inline/dist/webpack-4/bundle.js
  72. +0 −107 examples/inline/dist/webpack-4/index.html
  73. +63 −0 examples/inline/dist/webpack-5/bundle.js
  74. BIN examples/inline/dist/{webpack-4 → webpack-5}/favicon.ico
  75. +65 −0 examples/inline/dist/webpack-5/index.html
  76. 0 examples/{html-loader/dist/webpack-4 → inline/dist/webpack-5}/styles.css
  77. +0 −107 examples/javascript-advanced/dist/webpack-4/bundle.js
  78. +0 −1 examples/javascript-advanced/dist/webpack-4/index.html
  79. BIN ...14810ae3fb211173e2964249507195.png → javascript-advanced/dist/webpack-5/55b19870aff2e53d1fb1.png}
  80. +80 −0 examples/javascript-advanced/dist/webpack-5/bundle.js
  81. +1 −0 examples/javascript-advanced/dist/webpack-5/index.html
  82. 0 examples/{inline/dist/webpack-4 → javascript-advanced/dist/webpack-5}/styles.css
  83. +1 −1 examples/javascript-advanced/template.js
  84. +1 −1 examples/javascript-advanced/webpack.config.js
  85. +0 −107 examples/javascript/dist/webpack-4/bundle.js
  86. +0 −1 examples/javascript/dist/webpack-4/index.html
  87. BIN ...pack-4/0714810ae3fb211173e2964249507195.png → javascript/dist/webpack-5/55b19870aff2e53d1fb1.png}
  88. +84 −0 examples/javascript/dist/webpack-5/bundle.js
  89. +1 −0 examples/javascript/dist/webpack-5/index.html
  90. 0 examples/{javascript-advanced/dist/webpack-4 → javascript/dist/webpack-5}/styles.css
  91. +1 −1 examples/javascript/template.js
  92. +1 −3 examples/javascript/webpack.config.js
  93. +1 −0 examples/multi-page/dist/webpack-5/first.html
  94. +478 −0 examples/multi-page/dist/webpack-5/first.js
  95. +1 −0 examples/multi-page/dist/webpack-5/second.html
  96. +478 −0 examples/multi-page/dist/webpack-5/second.js
  97. 0 examples/{appcache/example.js → multi-page/first.js}
  98. 0 examples/{appcache → multi-page}/main.css
  99. +3 −0 examples/multi-page/readme.md
  100. +4 −0 examples/multi-page/second.js
  101. +27 −0 examples/multi-page/webpack.config.js
  102. +0 −1 examples/pug-loader/dist/webpack-4/index.html
  103. +150 −147 examples/pug-loader/dist/{webpack-4 → webpack-5}/bundle.js
  104. BIN examples/pug-loader/dist/{webpack-4 → webpack-5}/favicon.ico
  105. +1 −0 examples/pug-loader/dist/webpack-5/index.html
  106. 0 examples/{javascript/dist/webpack-4 → pug-loader/dist/webpack-5}/styles.css
  107. +1 −1 examples/pug-loader/webpack.config.js
  108. BIN examples/sort-manually/dist/webpack-4/0714810ae3fb211173e2964249507195.png
  109. +0 −106 examples/sort-manually/dist/webpack-4/a.js
  110. +0 −97 examples/sort-manually/dist/webpack-4/b.js
  111. +0 −99 examples/sort-manually/dist/webpack-4/c.js
  112. +0 −98 examples/sort-manually/dist/webpack-4/d.js
  113. +0 −99 examples/sort-manually/dist/webpack-4/e.js
  114. +0 −1 examples/sort-manually/dist/webpack-4/first-file.html
  115. +0 −1 examples/sort-manually/dist/webpack-4/second-file.html
  116. +0 −3 examples/sort-manually/dist/webpack-4/styles.css
  117. BIN ...k-4/0714810ae3fb211173e2964249507195.png → sort-manually/dist/webpack-5/55b19870aff2e53d1fb1.png}
  118. +63 −0 examples/sort-manually/dist/webpack-5/a.js
  119. +8 −0 examples/sort-manually/dist/webpack-5/b.js
  120. +8 −0 examples/sort-manually/dist/webpack-5/c.js
  121. +8 −0 examples/sort-manually/dist/webpack-5/d.js
  122. +8 −0 examples/sort-manually/dist/webpack-5/e.js
  123. +1 −0 examples/sort-manually/dist/webpack-5/first-file.html
  124. +1 −0 examples/sort-manually/dist/webpack-5/second-file.html
  125. 0 examples/{pug-loader/dist/webpack-4 → sort-manually/dist/webpack-5}/styles.css
  126. +1 −1 examples/sort-manually/webpack.config.js
  127. +0 −97 examples/template-parameters/dist/webpack-4/bundle.js
  128. +0 −1 examples/template-parameters/dist/webpack-4/index.html
  129. +8 −0 examples/template-parameters/dist/webpack-5/bundle.js
  130. +1 −0 examples/template-parameters/dist/webpack-5/index.html
  131. +15 −0 examples/template-parameters/webpack.config.js
  132. +604 −438 index.js
  133. +379 −0 lib/cached-child-compiler.js
  134. +206 −0 lib/child-compiler.js
  135. +0 −356 lib/compiler.js
  136. +71 −0 lib/file-watcher-api.js
  137. +8 −16 lib/hooks.js
  138. +36 −10 lib/html-tags.js
  139. +16 −9 lib/loader.js
  140. +5 −5 migration.md
  141. +30 −28 package.json
  142. +778 −154 spec/basic.spec.js
  143. +25 −22 spec/caching.spec.js
  144. +5 −6 spec/example.spec.js
  145. +1 −2 spec/fixtures/{legacy.html → interpolation.html}
  146. +4 −4 examples/appcache/template.html → spec/fixtures/logo.html
  147. BIN examples/javascript/dist/webpack-4/0714810ae3fb211173e2964249507195.png → spec/fixtures/logo.png
  148. +9 −0 spec/fixtures/src/index.ejs
  149. +2 −3 spec/hot.spec.js
  150. +0 −8 spec/support/jasmine.json
  151. +3 −1 tsconfig.json
  152. +240 −89 typings.d.ts
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: html-webpack-plugin
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
77 changes: 25 additions & 52 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,43 @@
---
name: Bug report
about: Create a report to help us improve
about: Create a 🕷 report to help us improve

---

## Expected behaviour
<!-- If you deleting this template this issue is very likely to be closed -->

Tell us what you would expect the html-webpack-plugin should.
## Current behaviour 💣

## Current behaviour
<!-- Tell us which problem you are facing which might be caused by a bug in the html-webpack-plugin -->

Tell us what the html-webpack-plugin does instead.
## Expected behaviour ☀️

## Environment
<!-- If not included in current behaviour please explain what should happen instead -->

Tell us which operating system you are using, as well as which versions of Node.js, npm, webpack, and html-webpack-plugin. Run the following to get it quickly:
### Reproduction Example 👾

```
node -e "var os=require('os');console.log('Node.js ' + process.version + '\n' + os.platform() + ' ' + os.release())"
npm --version
npm ls webpack
npm ls html-webpack-plugin
```
<!--
### Config
Please provide a minimal example how to reproduce your problem..
Delete all plugins which are unrelated
Delete all loaders which are unrelated
Delete the production webpack config if your bug happens on develop
Delete the develop webpack config if your bug happens only on production
Copy the minimal `webpack.config.js` to produce this issue:
Feel free to use this codebox template as a starting point: https://codesandbox.io/s/html-webpack-plugin-5x-alpha-d37s2?file=/webpack.config.js
-->

## Environment 🖥

```js
module.exports = {
entry: 'app.js',
output: {
path: 'dist',
filename: 'index_bundle.js'
},
module: {
rules: [
...
]
}
plugins: [
new HtmlWebpackPlugin(),
...
]
}
```

Copy your template file if it is part of this issue:
<!--
To help you we need to know which versions you using otherwise it is impossible to help you.
Please run the following commands to see your current versions:
```html
<!DOCTYPE html>
<html>
<head>
<title>My App</title>
</head>
<body>
</body>
</html>
```
node -e "var os=require('os');console.log('Node.js ' + process.version + '\n' + os.platform() + ' ' + os.release())"
npm --version
npm ls webpack
npm ls html-webpack-plugin
```
-->

## Relevant Links

- If your project is public, link to the repo so we can investigate directly.
- **BONUS POINTS:** Create a [minimal reproduction](http://stackoverflow.com/help/mcve) and upload it to GitHub. This will get you the fastest support.

## Additional context

Add any other context about the problem here.
37 changes: 37 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
name: test Node ${{ matrix.node }} Webpack ${{ matrix.webpack }} ${{ matrix.os }}
timeout-minutes: 15

runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ['10.x', '12.x', '14.x']
os: [ubuntu-latest, windows-latest, macOS-latest]
webpack: ['5']

steps:
- name: LF
run: git config --global core.autocrlf false

- name: Checkout repo
uses: actions/checkout@v2

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Install Dependencies
run: npm install --ignore-scripts --force --legacy-peer-deps

- name: Install Webpack ${{ matrix.webpack }}
run: npm install --ignore-scripts --force --legacy-peer-deps webpack@${{ matrix.webpack }}

- name: Test
run: npm test -- --forceExit || npm test -- --forceExit || npm test -- --forceExit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -4,3 +4,4 @@
npm-debug.*.log
yarn.lock
package-lock.json
npm-debug.log.*
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.11.5
10.13.0
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

297 changes: 296 additions & 1 deletion CHANGELOG.md

Large diffs are not rendered by default.

224 changes: 147 additions & 77 deletions README.md

Large diffs are not rendered by default.

23 changes: 0 additions & 23 deletions appveyor.yml

This file was deleted.

19 changes: 10 additions & 9 deletions docs/template-option.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

## History

The version 2.x which was introduced last year (Sep, 2015) changed the way the template is processed.
The version 2.x which was introduced 2015 changed the way the template is processed.
Instead of forcing all users to use the [blueimp](https://github.com/blueimp/JavaScript-Templates) template engine it allowed to use any webpack loader:

* [pug](https://github.com/pugjs/pug-loader)
@@ -19,7 +19,8 @@ There are three ways to set the loader:

## 1) Don't set any loader

By default (if you don't specify any loader in any way) a [fallback lodash loader](https://github.com/ampedandwired/html-webpack-plugin/blob/master/lib/loader.js) kicks in.
By default (if you don't specify any loader in any way) a [fallback ejs loader](https://github.com/jantimon/html-webpack-plugin/blob/master/lib/loader.js) kicks in.
Please note that this loader does not support the full ejs syntax as it is based on [lodash template](https://lodash.com/docs/#template).

```js
{
@@ -31,23 +32,23 @@ By default (if you don't specify any loader in any way) a [fallback lodash loade
}
```

Be aware, using `.html` as your template extention may unexpectedly trigger another loader.
Be aware, using `.html` as your template extension may unexpectedly trigger another loader.

## 2) Setting a loader directly for the template

```js
new HtmlWebpackPlugin({
// For details on `!!` see https://webpack.github.io/docs/loaders.html#loader-order
template: '!!handlebars!src/index.hbs'
// For details on `!!` see https://webpack.js.org/concepts/loaders/#inline
template: '!!handlebars-loader!src/index.hbs'
})
```

## 3) Setting a loader using the `module.loaders` syntax
## 3) Setting a loader using the `module.rules` syntax

```js
{
module: {
loaders: [
rules: [
{
test: /\.hbs$/,
loader: 'handlebars-loader'
@@ -63,12 +64,12 @@ new HtmlWebpackPlugin({
```

However this also means that in the following example webpack will use the [html loader for your template](https://webpack.js.org/loaders/html-loader/).
This will **cause html minification** and it will also **disable the ejs fallback** loader.
This will **cause html minification** and it will also **disable the ejs/lodash fallback** loader.

```js
{
module: {
loaders: [
rules: [
{
test: /\.html$/,
loader: 'html-loader'
19 changes: 19 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Examples

A collection of repositories or pages using html-webpack-plugin.

Example | Link
--- | ---
Appcache | [appcache](./appcache)
Chunk Optimization | [chunk-optimization](./chunk-optimization)
Custom Template | [custom-template](./custom-template)
Custom Script / Link tag position | [custom-insertion-point](./custom-insertion-position)
Default | [default](./default)
Favicon | [favicon](./favicon.)
Html Loader | [html-loader](./html-loader)
Inline | [inline](./inline)
Javascript-advanced | [javascript-advanced](./javascript-advanced)
Javascript | [javascript](./javascript)
Pug Loader | [pug-loader](./pug-loader)
Sort Manually | [sort-manually](./sort-manually)
Template Parameters | [template-parameters](./template-parameters)
104 changes: 0 additions & 104 deletions examples/appcache/dist/webpack-4/bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion examples/appcache/dist/webpack-4/index.html

This file was deleted.

9 changes: 0 additions & 9 deletions examples/appcache/dist/webpack-4/manifest.appcache

This file was deleted.

34 changes: 0 additions & 34 deletions examples/appcache/webpack.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion examples/build-examples.js
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ examples.forEach(function (exampleName) {
var configFile = path.join(examplePath, 'webpack.config.js');

var config = require(configFile);
if (webpackMajorVersion === '4') {
if (Number(webpackMajorVersion) >= 4) {
config.plugins.unshift(new webpack.LoaderOptionsPlugin({
options: {
context: process.cwd() // or the same value as `context`
1 change: 0 additions & 1 deletion examples/chunk-optimization/dist/webpack-4/entryA.html

This file was deleted.

170 changes: 0 additions & 170 deletions examples/chunk-optimization/dist/webpack-4/entryA.js

This file was deleted.

43 changes: 0 additions & 43 deletions examples/chunk-optimization/dist/webpack-4/entryA~entryB.js

This file was deleted.

1 change: 0 additions & 1 deletion examples/chunk-optimization/dist/webpack-4/entryB.html

This file was deleted.

169 changes: 0 additions & 169 deletions examples/chunk-optimization/dist/webpack-4/entryB.js

This file was deleted.

1 change: 0 additions & 1 deletion examples/chunk-optimization/dist/webpack-4/entryC.html

This file was deleted.

13 changes: 0 additions & 13 deletions examples/chunk-optimization/dist/webpack-4/libText.js

This file was deleted.

585 changes: 0 additions & 585 deletions examples/chunk-optimization/dist/webpack-4/vendors~entryA~entryB.js

This file was deleted.

352 changes: 352 additions & 0 deletions examples/chunk-optimization/dist/webpack-5/219.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,352 @@
(self["webpackChunk"] = self["webpackChunk"] || []).push([[219],{

/***/ 609:
/***/ ((module) => {

"use strict";


/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
// css base code, injected by the css-loader
// eslint-disable-next-line func-names
module.exports = function (cssWithMappingToString) {
var list = []; // return the list of modules as css string

list.toString = function toString() {
return this.map(function (item) {
var content = cssWithMappingToString(item);

if (item[2]) {
return "@media ".concat(item[2], " {").concat(content, "}");
}

return content;
}).join('');
}; // import a list of modules into the list
// eslint-disable-next-line func-names


list.i = function (modules, mediaQuery, dedupe) {
if (typeof modules === 'string') {
// eslint-disable-next-line no-param-reassign
modules = [[null, modules, '']];
}

var alreadyImportedModules = {};

if (dedupe) {
for (var i = 0; i < this.length; i++) {
// eslint-disable-next-line prefer-destructuring
var id = this[i][0];

if (id != null) {
alreadyImportedModules[id] = true;
}
}
}

for (var _i = 0; _i < modules.length; _i++) {
var item = [].concat(modules[_i]);

if (dedupe && alreadyImportedModules[item[0]]) {
// eslint-disable-next-line no-continue
continue;
}

if (mediaQuery) {
if (!item[2]) {
item[2] = mediaQuery;
} else {
item[2] = "".concat(mediaQuery, " and ").concat(item[2]);
}
}

list.push(item);
}
};

return list;
};

/***/ }),

/***/ 62:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";


var isOldIE = function isOldIE() {
var memo;
return function memorize() {
if (typeof memo === 'undefined') {
// Test for IE <= 9 as proposed by Browserhacks
// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
// Tests for existence of standard globals is to allow style-loader
// to operate correctly into non-standard environments
// @see https://github.com/webpack-contrib/style-loader/issues/177
memo = Boolean(window && document && document.all && !window.atob);
}

return memo;
};
}();

var getTarget = function getTarget() {
var memo = {};
return function memorize(target) {
if (typeof memo[target] === 'undefined') {
var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself

if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
try {
// This will throw an exception if access to iframe is blocked
// due to cross-origin restrictions
styleTarget = styleTarget.contentDocument.head;
} catch (e) {
// istanbul ignore next
styleTarget = null;
}
}

memo[target] = styleTarget;
}

return memo[target];
};
}();

var stylesInDom = [];

function getIndexByIdentifier(identifier) {
var result = -1;

for (var i = 0; i < stylesInDom.length; i++) {
if (stylesInDom[i].identifier === identifier) {
result = i;
break;
}
}

return result;
}

function modulesToDom(list, options) {
var idCountMap = {};
var identifiers = [];

for (var i = 0; i < list.length; i++) {
var item = list[i];
var id = options.base ? item[0] + options.base : item[0];
var count = idCountMap[id] || 0;
var identifier = "".concat(id, " ").concat(count);
idCountMap[id] = count + 1;
var index = getIndexByIdentifier(identifier);
var obj = {
css: item[1],
media: item[2],
sourceMap: item[3]
};

if (index !== -1) {
stylesInDom[index].references++;
stylesInDom[index].updater(obj);
} else {
stylesInDom.push({
identifier: identifier,
updater: addStyle(obj, options),
references: 1
});
}

identifiers.push(identifier);
}

return identifiers;
}

function insertStyleElement(options) {
var style = document.createElement('style');
var attributes = options.attributes || {};

if (typeof attributes.nonce === 'undefined') {
var nonce = true ? __webpack_require__.nc : 0;

if (nonce) {
attributes.nonce = nonce;
}
}

Object.keys(attributes).forEach(function (key) {
style.setAttribute(key, attributes[key]);
});

if (typeof options.insert === 'function') {
options.insert(style);
} else {
var target = getTarget(options.insert || 'head');

if (!target) {
throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
}

target.appendChild(style);
}

return style;
}

function removeStyleElement(style) {
// istanbul ignore if
if (style.parentNode === null) {
return false;
}

style.parentNode.removeChild(style);
}
/* istanbul ignore next */


var replaceText = function replaceText() {
var textStore = [];
return function replace(index, replacement) {
textStore[index] = replacement;
return textStore.filter(Boolean).join('\n');
};
}();

function applyToSingletonTag(style, index, remove, obj) {
var css = remove ? '' : obj.media ? "@media ".concat(obj.media, " {").concat(obj.css, "}") : obj.css; // For old IE

/* istanbul ignore if */

if (style.styleSheet) {
style.styleSheet.cssText = replaceText(index, css);
} else {
var cssNode = document.createTextNode(css);
var childNodes = style.childNodes;

if (childNodes[index]) {
style.removeChild(childNodes[index]);
}

if (childNodes.length) {
style.insertBefore(cssNode, childNodes[index]);
} else {
style.appendChild(cssNode);
}
}
}

function applyToTag(style, options, obj) {
var css = obj.css;
var media = obj.media;
var sourceMap = obj.sourceMap;

if (media) {
style.setAttribute('media', media);
} else {
style.removeAttribute('media');
}

if (sourceMap && typeof btoa !== 'undefined') {
css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
} // For old IE

/* istanbul ignore if */


if (style.styleSheet) {
style.styleSheet.cssText = css;
} else {
while (style.firstChild) {
style.removeChild(style.firstChild);
}

style.appendChild(document.createTextNode(css));
}
}

var singleton = null;
var singletonCounter = 0;

function addStyle(obj, options) {
var style;
var update;
var remove;

if (options.singleton) {
var styleIndex = singletonCounter++;
style = singleton || (singleton = insertStyleElement(options));
update = applyToSingletonTag.bind(null, style, styleIndex, false);
remove = applyToSingletonTag.bind(null, style, styleIndex, true);
} else {
style = insertStyleElement(options);
update = applyToTag.bind(null, style, options);

remove = function remove() {
removeStyleElement(style);
};
}

update(obj);
return function updateStyle(newObj) {
if (newObj) {
if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
return;
}

update(obj = newObj);
} else {
remove();
}
};
}

module.exports = function (list, options) {
options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
// tags it will allow on a page

if (!options.singleton && typeof options.singleton !== 'boolean') {
options.singleton = isOldIE();
}

list = list || [];
var lastIdentifiers = modulesToDom(list, options);
return function update(newList) {
newList = newList || [];

if (Object.prototype.toString.call(newList) !== '[object Array]') {
return;
}

for (var i = 0; i < lastIdentifiers.length; i++) {
var identifier = lastIdentifiers[i];
var index = getIndexByIdentifier(identifier);
stylesInDom[index].references--;
}

var newLastIdentifiers = modulesToDom(newList, options);

for (var _i = 0; _i < lastIdentifiers.length; _i++) {
var _identifier = lastIdentifiers[_i];

var _index = getIndexByIdentifier(_identifier);

if (stylesInDom[_index].references === 0) {
stylesInDom[_index].updater();

stylesInDom.splice(_index, 1);
}
}

lastIdentifiers = newLastIdentifiers;
};
};

/***/ })

}]);
50 changes: 50 additions & 0 deletions examples/chunk-optimization/dist/webpack-5/965.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
(self["webpackChunk"] = self["webpackChunk"] || []).push([[965],{

/***/ 173:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(609);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
// Imports

var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
// Module
___CSS_LOADER_EXPORT___.push([module.id, "body {\n background: snow;\n}", ""]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 965:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(62);
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(173);



var options = {};

options.insert = "head";
options.singleton = false;

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__/* .default */ .Z, options);



/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__/* .default.locals */ .Z.locals || {});

/***/ })

}]);
1 change: 1 addition & 0 deletions examples/chunk-optimization/dist/webpack-5/entryA.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html><html><head><meta charset="utf-8"><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"><script defer="defer" src="libMath.js"></script><script defer="defer" src="libText.js"></script><script defer="defer" src="219.js"></script><script defer="defer" src="965.js"></script><script defer="defer" src="entryA.js"></script></head><body></body></html>
184 changes: 184 additions & 0 deletions examples/chunk-optimization/dist/webpack-5/entryA.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({

/***/ 727:
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

__webpack_require__(965);
var multiply = __webpack_require__(179);
var concat = __webpack_require__(631);
var h1 = document.createElement('h1');
h1.innerHTML = concat('Hello world from Entry ', multiply(1, 1));
document.body.appendChild(h1);


/***/ })

/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ id: moduleId,
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = __webpack_modules__;
/******/
/******/ // the startup function
/******/ // It's empty as some runtime module handles the default behavior
/******/ __webpack_require__.x = x => {};
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/jsonp chunk loading */
/******/ (() => {
/******/ // no baseURI
/******/
/******/ // object to store loaded and loading chunks
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // Promise = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ 938: 0
/******/ };
/******/
/******/ var deferredModules = [
/******/ [727,494,491,219,965]
/******/ ];
/******/ // no chunk on demand loading
/******/
/******/ // no prefetching
/******/
/******/ // no preloaded
/******/
/******/ // no HMR
/******/
/******/ // no HMR manifest
/******/
/******/ var checkDeferredModules = x => {};
/******/
/******/ // install a JSONP callback for chunk loading
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
/******/ var [chunkIds, moreModules, runtime, executeModules] = data;
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, resolves = [];
/******/ for(;i < chunkIds.length; i++) {
/******/ chunkId = chunkIds[i];
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ resolves.push(installedChunks[chunkId][0]);
/******/ }
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ for(moduleId in moreModules) {
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(runtime) runtime(__webpack_require__);
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
/******/ while(resolves.length) {
/******/ resolves.shift()();
/******/ }
/******/
/******/ // add entry modules from loaded chunk to deferred list
/******/ if(executeModules) deferredModules.push.apply(deferredModules, executeModules);
/******/
/******/ // run deferred modules when all chunks ready
/******/ return checkDeferredModules();
/******/ }
/******/
/******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || [];
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
/******/
/******/ function checkDeferredModulesImpl() {
/******/ var result;
/******/ for(var i = 0; i < deferredModules.length; i++) {
/******/ var deferredModule = deferredModules[i];
/******/ var fulfilled = true;
/******/ for(var j = 1; j < deferredModule.length; j++) {
/******/ var depId = deferredModule[j];
/******/ if(installedChunks[depId] !== 0) fulfilled = false;
/******/ }
/******/ if(fulfilled) {
/******/ deferredModules.splice(i--, 1);
/******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
/******/ }
/******/ }
/******/ if(deferredModules.length === 0) {
/******/ __webpack_require__.x();
/******/ __webpack_require__.x = x => {};
/******/ }
/******/ return result;
/******/ }
/******/ var startup = __webpack_require__.x;
/******/ __webpack_require__.x = () => {
/******/ // reset startup function so it can be called again when more startup code is added
/******/ __webpack_require__.x = startup || (x => {});
/******/ return (checkDeferredModules = checkDeferredModulesImpl)();
/******/ };
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // run startup
/******/ var __webpack_exports__ = __webpack_require__.x();
/******/
/******/ })()
;
1 change: 1 addition & 0 deletions examples/chunk-optimization/dist/webpack-5/entryB.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html><html><head><meta charset="utf-8"><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"><script defer="defer" src="libMath.js"></script><script defer="defer" src="219.js"></script><script defer="defer" src="965.js"></script><script defer="defer" src="entryB.js"></script></head><body></body></html>
183 changes: 183 additions & 0 deletions examples/chunk-optimization/dist/webpack-5/entryB.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({

/***/ 282:
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

__webpack_require__(965);
var multiply = __webpack_require__(179);
var h1 = document.createElement('h1');
h1.innerHTML = 'Hello world from Entry ' + multiply(1, 2);
document.body.appendChild(h1);


/***/ })

/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ id: moduleId,
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = __webpack_modules__;
/******/
/******/ // the startup function
/******/ // It's empty as some runtime module handles the default behavior
/******/ __webpack_require__.x = x => {};
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/jsonp chunk loading */
/******/ (() => {
/******/ // no baseURI
/******/
/******/ // object to store loaded and loading chunks
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // Promise = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ 513: 0
/******/ };
/******/
/******/ var deferredModules = [
/******/ [282,494,219,965]
/******/ ];
/******/ // no chunk on demand loading
/******/
/******/ // no prefetching
/******/
/******/ // no preloaded
/******/
/******/ // no HMR
/******/
/******/ // no HMR manifest
/******/
/******/ var checkDeferredModules = x => {};
/******/
/******/ // install a JSONP callback for chunk loading
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
/******/ var [chunkIds, moreModules, runtime, executeModules] = data;
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, resolves = [];
/******/ for(;i < chunkIds.length; i++) {
/******/ chunkId = chunkIds[i];
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ resolves.push(installedChunks[chunkId][0]);
/******/ }
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ for(moduleId in moreModules) {
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(runtime) runtime(__webpack_require__);
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
/******/ while(resolves.length) {
/******/ resolves.shift()();
/******/ }
/******/
/******/ // add entry modules from loaded chunk to deferred list
/******/ if(executeModules) deferredModules.push.apply(deferredModules, executeModules);
/******/
/******/ // run deferred modules when all chunks ready
/******/ return checkDeferredModules();
/******/ }
/******/
/******/ var chunkLoadingGlobal = self["webpackChunk"] = self["webpackChunk"] || [];
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
/******/
/******/ function checkDeferredModulesImpl() {
/******/ var result;
/******/ for(var i = 0; i < deferredModules.length; i++) {
/******/ var deferredModule = deferredModules[i];
/******/ var fulfilled = true;
/******/ for(var j = 1; j < deferredModule.length; j++) {
/******/ var depId = deferredModule[j];
/******/ if(installedChunks[depId] !== 0) fulfilled = false;
/******/ }
/******/ if(fulfilled) {
/******/ deferredModules.splice(i--, 1);
/******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
/******/ }
/******/ }
/******/ if(deferredModules.length === 0) {
/******/ __webpack_require__.x();
/******/ __webpack_require__.x = x => {};
/******/ }
/******/ return result;
/******/ }
/******/ var startup = __webpack_require__.x;
/******/ __webpack_require__.x = () => {
/******/ // reset startup function so it can be called again when more startup code is added
/******/ __webpack_require__.x = startup || (x => {});
/******/ return (checkDeferredModules = checkDeferredModulesImpl)();
/******/ };
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // run startup
/******/ var __webpack_exports__ = __webpack_require__.x();
/******/
/******/ })()
;
1 change: 1 addition & 0 deletions examples/chunk-optimization/dist/webpack-5/entryC.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html><html><head><meta charset="utf-8"><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"><script defer="defer" src="libMath.js"></script><script defer="defer" src="libText.js"></script><script defer="defer" src="219.js"></script><script defer="defer" src="965.js"></script><script defer="defer" src="entryA.js"></script><script defer="defer" src="entryB.js"></script></head><body></body></html>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[0],{
(self["webpackChunk"] = self["webpackChunk"] || []).push([[494],{

/***/ 1:
/***/ (function(module, exports, __webpack_require__) {
/***/ 179:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var sum = __webpack_require__(7);
var sum = __webpack_require__(971);
module.exports = function multiply (a, b) {
var m = 0;
for (var i = 0; i < a; i = sum(i, 1)) {
@@ -15,8 +15,8 @@ module.exports = function multiply (a, b) {

/***/ }),

/***/ 7:
/***/ (function(module, exports) {
/***/ 971:
/***/ ((module) => {

module.exports = function sum (a, b) {
return a + b;
13 changes: 13 additions & 0 deletions examples/chunk-optimization/dist/webpack-5/libText.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
(self["webpackChunk"] = self["webpackChunk"] || []).push([[491],{

/***/ 631:
/***/ ((module) => {

module.exports = function concat (a, b) {
return String(a) + String(b);
};


/***/ })

}]);
6 changes: 3 additions & 3 deletions examples/chunk-optimization/webpack.config.js
Original file line number Diff line number Diff line change
@@ -15,8 +15,8 @@ module.exports = {
},
module: {
rules: [
{ test: /\.css$/, loader: 'style-loader!css-loader' },
{ test: /\.png$/, loader: 'file-loader' }
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
{ test: /\.png$/, type: 'asset/resource' }
]
},
optimization: {
@@ -25,7 +25,7 @@ module.exports = {
minSize: 0,
maxAsyncRequests: 9,
maxInitialRequests: 9,
name: true,
name: false,
cacheGroups: {
libMath: {
test: /lib-(multiply|sum)/,
8 changes: 8 additions & 0 deletions examples/custom-insertion-position/dist/webpack-5/bundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/******/ (() => { // webpackBootstrap
var __webpack_exports__ = {};
var h1 = document.createElement('h1');
h1.innerHTML = 'Hello world!';
document.body.appendChild(h1);

/******/ })()
;
12 changes: 12 additions & 0 deletions examples/custom-insertion-position/dist/webpack-5/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script defer src="bundle.js"></script>
<title>Custom insertion example</title>
</head>
<body>
All scripts are placed here:

<script>console.log("Executed after all other scripts")</script>
</body>
</html>
3 changes: 3 additions & 0 deletions examples/custom-insertion-position/example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
var h1 = document.createElement('h1');
h1.innerHTML = 'Hello world!';
document.body.appendChild(h1);
12 changes: 12 additions & 0 deletions examples/custom-insertion-position/index.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<%= htmlWebpackPlugin.tags.headTags %>
<title>Custom insertion example</title>
</head>
<body>
All scripts are placed here:
<%= htmlWebpackPlugin.tags.bodyTags %>
<script>console.log("Executed after all other scripts")</script>
</body>
</html>
24 changes: 24 additions & 0 deletions examples/custom-insertion-position/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# custom insertion example

This example shows how you can define the position where the scripts are injected
by setting `inject:false` and using the template parameters inside the `index.ejs`

The example is using the template parameters `headTags` and `bodyTags`

```
<%= htmlWebpackPlugin.tags.headTags %>
<%= htmlWebpackPlugin.tags.bodyTags %>
```

`headTags` and `bodyTags` are arrays so you can use any Array.prototype function like `filter`:

```
<%= htmlWebpackPlugin
.tags
.headTags
.filter((tag) => tag.tagName === 'meta')
.join('')
%>
```

For further information about the tag object take a look at the `createHtmlTagObject` inside `lib/html-tags.js` or at the `prepareAssetTagGroupForRendering` inside `index.js`.
25 changes: 25 additions & 0 deletions examples/custom-insertion-position/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
var path = require('path');
var HtmlWebpackPlugin = require('../..');
var webpackMajorVersion = require('webpack/package.json').version.split('.')[0];
module.exports = {
context: __dirname,
entry: './example.js',
output: {
path: path.join(__dirname, 'dist/webpack-' + webpackMajorVersion),
publicPath: '',
filename: 'bundle.js'
},
plugins: [
new HtmlWebpackPlugin({
template: 'index.ejs',
inject: false,
// The following settings are optional and only used for
// demo purposes:
meta: {
charset: { charset: 'utf-8' },
viewport: 'width=device-width, initial-scale=1'
},
minify: false
})
]
};
104 changes: 0 additions & 104 deletions examples/custom-template/dist/webpack-4/bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion examples/custom-template/dist/webpack-4/index.html

This file was deleted.

63 changes: 63 additions & 0 deletions examples/custom-template/dist/webpack-5/bundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({

/***/ 636:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ })

/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {
__webpack_require__(636);
var h1 = document.createElement('h1');
h1.innerHTML = 'Hello world!';
document.body.appendChild(h1);

})();

/******/ })()
;
1 change: 1 addition & 0 deletions examples/custom-template/dist/webpack-5/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"><script defer="defer" src="bundle.js"></script><link href="styles.css" rel="stylesheet"></head><body><h2>Partial</h2><img src="55b19870aff2e53d1fb1.png"></body></html>
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/custom-template/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# custom template

This example uses a custom underscore template which inlines an partial using the html-loader:
`<%= require('html-loader!./partial.html') %>`
`<%= require('html-loader!./partial.html').default %>`
2 changes: 1 addition & 1 deletion examples/custom-template/template.html
Original file line number Diff line number Diff line change
@@ -6,6 +6,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<%= require('html-loader!./partial.html') %>
<%= require('html-loader!./partial.html').default %>
</body>
</html>
2 changes: 1 addition & 1 deletion examples/custom-template/webpack.config.js
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ module.exports = {
module: {
rules: [
{ test: /\.css$/, use: [MiniCssExtractPlugin.loader, 'css-loader'] },
{ test: /\.png$/, loader: 'file-loader' }
{ test: /\.png$/, type: 'asset/resource' }
]
},
plugins: [
718 changes: 0 additions & 718 deletions examples/default/dist/webpack-4/bundle.js

This file was deleted.

478 changes: 478 additions & 0 deletions examples/default/dist/webpack-5/bundle.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html><head><meta charset="utf-8"><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"></head><body><script src="bundle.js"></script></body></html>
<!doctype html><html><head><meta charset="utf-8"><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"><script defer="defer" src="bundle.js"></script></head><body></body></html>
4 changes: 2 additions & 2 deletions examples/default/webpack.config.js
Original file line number Diff line number Diff line change
@@ -12,8 +12,8 @@ module.exports = {
},
module: {
rules: [
{ test: /\.css$/, loader: 'style-loader!css-loader' },
{ test: /\.png$/, loader: 'file-loader' }
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
{ test: /\.png$/, type: 'asset/resource' }
]
},
plugins: [
104 changes: 0 additions & 104 deletions examples/favicon/dist/webpack-4/bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion examples/favicon/dist/webpack-4/favicon.html

This file was deleted.

63 changes: 63 additions & 0 deletions examples/favicon/dist/webpack-5/bundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({

/***/ 636:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ })

/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {
__webpack_require__(636);
var h1 = document.createElement('h1');
h1.innerHTML = 'Hello world!';
document.body.appendChild(h1);

})();

/******/ })()
;
1 change: 1 addition & 0 deletions examples/favicon/dist/webpack-5/favicon.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html><html><head><meta charset="utf-8"><title>HtmlWebpackPlugin example</title><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><script defer="defer" src="bundle.js"></script><link href="styles.css" rel="stylesheet"></head><body></body></html>
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/favicon/webpack.config.js
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ module.exports = {
module: {
rules: [
{ test: /\.css$/, use: [MiniCssExtractPlugin.loader, 'css-loader'] },
{ test: /\.png$/, loader: 'file-loader' }
{ test: /\.png$/, type: 'asset/resource' }
]
},
plugins: [
1 change: 0 additions & 1 deletion examples/html-loader/dist/webpack-4/about.html

This file was deleted.

104 changes: 0 additions & 104 deletions examples/html-loader/dist/webpack-4/bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion examples/html-loader/dist/webpack-4/index.html

This file was deleted.

File renamed without changes
1 change: 1 addition & 0 deletions examples/html-loader/dist/webpack-5/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Example template</title><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><script defer="defer" src="bundle.js"></script><link href="styles.css" rel="stylesheet"></head><body><img src="55b19870aff2e53d1fb1.png"></body></html>
63 changes: 63 additions & 0 deletions examples/html-loader/dist/webpack-5/bundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({

/***/ 636:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ })

/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {
__webpack_require__(636);
var h1 = document.createElement('h1');
h1.innerHTML = 'Hello world!';
document.body.appendChild(h1);

})();

/******/ })()
;
1 change: 1 addition & 0 deletions examples/html-loader/dist/webpack-5/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Example template</title><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><script defer="defer" src="bundle.js"></script><link href="styles.css" rel="stylesheet"></head><body><img src="55b19870aff2e53d1fb1.png"></body></html>
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/html-loader/webpack.config.js
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ module.exports = {
module: {
rules: [
{ test: /\.css$/, use: [MiniCssExtractPlugin.loader, 'css-loader'] },
{ test: /\.png$/, loader: 'file-loader' },
{ test: /\.png$/, type: 'asset/resource' },
{ test: /\.html$/, loader: 'html-loader' }
]
},
105 changes: 0 additions & 105 deletions examples/inline/dist/webpack-4/bundle.js

This file was deleted.

107 changes: 0 additions & 107 deletions examples/inline/dist/webpack-4/index.html

This file was deleted.

63 changes: 63 additions & 0 deletions examples/inline/dist/webpack-5/bundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({

/***/ 636:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ })

/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {

__webpack_require__(636);

console.log('Hello World');

})();

/******/ })()
;
File renamed without changes.
65 changes: 65 additions & 0 deletions examples/inline/dist/webpack-5/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!doctype html><html><head><meta charset="utf-8"><title>pug demo</title></head><body><style>body {
background: snow;
}</style><script>/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({

/***/ 636:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ })

/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {

__webpack_require__(636);

console.log('Hello World');

})();

/******/ })()
;</script></body></html>
File renamed without changes.
107 changes: 0 additions & 107 deletions examples/javascript-advanced/dist/webpack-4/bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion examples/javascript-advanced/dist/webpack-4/index.html

This file was deleted.

80 changes: 80 additions & 0 deletions examples/javascript-advanced/dist/webpack-5/bundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({

/***/ 144:
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

eval("__webpack_require__(636);\n\nvar universal = __webpack_require__(184);\nvar h1 = document.createElement('h1');\nh1.innerHTML = universal();\n\ndocument.body.appendChild(h1);\n\n\n//# sourceURL=webpack:///./example.js?");

/***/ }),

/***/ 184:
/***/ ((module) => {

"use strict";
eval("// This file is used for frontend and backend\n\n\n// If compiled by the html-webpack-plugin\n// HTML_WEBPACK_PLUGIN is set to true:\nvar backend = typeof HTML_WEBPACK_PLUGIN !== 'undefined';\n\nmodule.exports = function () {\n return 'Hello World from ' + (backend ? 'backend' : 'frontend');\n};\n\n\n//# sourceURL=webpack:///./universial.js?");

/***/ }),

/***/ 636:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack:///./main.css?");

/***/ })

/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval devtool is used.
/******/ var __webpack_exports__ = __webpack_require__(144);
/******/
/******/ })()
;
Loading