Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
0fa8fa4
Fix get img
sgb004 Mar 9, 2022
a975307
update dependencies
sgb004 Mar 9, 2022
d0978dc
Pass options to HTMLWebpackPlugin through templateParameters
sgb004 Mar 9, 2022
3a7bb3a
I change the way to get the index.html generated by webpack because r…
sgb004 Mar 9, 2022
c33d23a
I changed analytics.html because HTMLWebpackPlugin no longer puts scr…
sgb004 Mar 9, 2022
f11fffe
These files change due to update of webpack and HTMLWebpackPlugin
sgb004 Mar 9, 2022
96b8396
I change the way to get the index.html and other-page.html generated …
sgb004 Mar 9, 2022
e18ac26
I changed basic-multi-index.html and basic-multi-other.html because H…
sgb004 Mar 9, 2022
7193f39
These files change due to update of webpack and HTMLWebpackPlugin
sgb004 Mar 9, 2022
057b8b9
I change the way to get the index.html generated by webpack because r…
sgb004 Mar 9, 2022
2da36a7
I changed basic.html because HTMLWebpackPlugin no longer puts scripts…
sgb004 Mar 9, 2022
401615c
These files change due to update of webpack and HTMLWebpackPlugin
sgb004 Mar 9, 2022
b344710
I changed the way to get the index.html generated by webpack because …
sgb004 Mar 9, 2022
a7bcb23
I changed body-attribute.html because HTMLWebpackPlugin no longer put…
sgb004 Mar 9, 2022
541b728
These files change due to update of webpack and HTMLWebpackPlugin
sgb004 Mar 9, 2022
8b08f51
I changed the way to get the index.html generated by webpack because …
sgb004 Mar 9, 2022
38824e3
I changed custom-multi-template-filename-index.html and custom-multi-…
sgb004 Mar 9, 2022
70427e6
These files change due to update of webpack and HTMLWebpackPlugin
sgb004 Mar 9, 2022
a9320ef
I changed the way to get the index.html generated by webpack because …
sgb004 Mar 10, 2022
1d85f9b
I changed high-priority-head-no-meta.html because HTMLWebpackPlugin n…
sgb004 Mar 10, 2022
36a8250
These files change due to update of webpack and HTMLWebpackPlugin
sgb004 Mar 10, 2022
c5f00f1
I changed the way to get the index.html generated by webpack because …
sgb004 Mar 10, 2022
1f18834
I changed high-priority-head.html because HTMLWebpackPlugin no longer…
sgb004 Mar 10, 2022
3d149a9
These files change due to update of webpack and HTMLWebpackPlugin
sgb004 Mar 10, 2022
482fad0
html-loader added to package.json
sgb004 Mar 10, 2022
f2e55a8
Updated settings to fetch images using html-loader with the changes a…
sgb004 Mar 10, 2022
e1623c2
Documentation update for the html-loader example
sgb004 Mar 10, 2022
cebfdfe
These files change due to update of the plugin, the webpack and HTMLW…
sgb004 Mar 10, 2022
32dea6d
New test for the html-loader example
sgb004 Mar 10, 2022
c253b5c
Updated settings to minify using html-loader with the changes applied…
sgb004 Mar 10, 2022
f24b452
Documentation update for the Minify example
sgb004 Mar 10, 2022
882d422
These files change due to update documentation and the update last ve…
sgb004 Mar 10, 2022
a28eba5
I changed the way to get the index.html generated by webpack because …
sgb004 Mar 10, 2022
9b7703e
These files change due to update documentation and the update last ve…
sgb004 Mar 10, 2022
05e2a0b
I changed minify.html because HTMLWebpackPlugin no longer puts script…
sgb004 Mar 10, 2022
a3957a3
I changed the way to get the index.html generated by webpack because …
sgb004 Mar 10, 2022
43f2141
I changed page-template-about.html and page-template-index.html becau…
sgb004 Mar 10, 2022
3a9bfba
These files change due to update of the plugin webpack and HTMLWebpac…
sgb004 Mar 10, 2022
1998753
I changed the way to get the index.html generated by webpack because …
sgb004 Mar 11, 2022
a32d5f2
I changed react-root.html because HTMLWebpackPlugin no longer puts sc…
sgb004 Mar 11, 2022
9c3eb65
These files change due to update of the plugin webpack and HTMLWebpac…
sgb004 Mar 11, 2022
e667301
I changed the way to get the index.html generated by webpack because …
sgb004 Mar 11, 2022
f07e548
I changed replace-element.html because HTMLWebpackPlugin no longer pu…
sgb004 Mar 11, 2022
ecd33fc
These files change due to update of the plugin webpack and HTMLWebpac…
sgb004 Mar 11, 2022
d85a62a
I changed the way to get the index.html generated by webpack because …
sgb004 Mar 11, 2022
adab3c7
I changed the way to get the index.html generated by webpack because …
sgb004 Mar 11, 2022
5e5f348
I changed variables.html because HTMLWebpackPlugin no longer puts scr…
sgb004 Mar 11, 2022
28032a5
These files change due to update of the plugin webpack and HTMLWebpac…
sgb004 Mar 11, 2022
3e331a7
Restoration of the test script.
sgb004 Mar 14, 2022
8f499ae
The filesProcessed variable is no longer static.
sgb004 Apr 1, 2022
ad34bc3
At fix filesProcessed it no longer necessary to change timeout in moc…
sgb004 Apr 1, 2022
680ee85
This test takes a few seconds more, I didn't find a reason as with th…
sgb004 Apr 1, 2022
81fbde4
Change in the minimum version of nodejs required.
sgb004 Apr 1, 2022
311a476
Change the version of nodejs used in the workflow test because some m…
sgb004 Apr 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Uses Node.js 10
- name: Uses Node.js 12.13.0
uses: actions/setup-node@v1
with:
node-version: 10
node-version: 12.13.0
- run: npm install -g yarn
- run: yarn install
- run: yarn test
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.16.3
12.13.0
4 changes: 2 additions & 2 deletions examples/analytics/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-28076707-7');</script><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"></head><body><h1>Hello world!</h1><hr/><h2>webpack.config.js</h2><pre>
gtag('config', 'UA-28076707-7');</script><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"><script defer="defer" src="main.js"></script></head><body><h1>Hello world!</h1><hr/><h2>webpack.config.js</h2><pre>
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackPartialsPlugin = require('../../');
Expand Down Expand Up @@ -48,4 +48,4 @@

gtag(&#x27;config&#x27;, &#x27;&#x3C;%= ga_property_id %&#x3E;&#x27;);
&#x3C;/script&#x3E;
</pre><script src="main.js"></script></body></html>
</pre></body></html>
2 changes: 1 addition & 1 deletion examples/analytics/dist/main.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){console.log("Test!")}]);
console.log("Test!");
4 changes: 2 additions & 2 deletions examples/basic-multi/dist/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!doctype html><html><head><meta charset="utf-8"><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"></head><body><h1>Hello world!</h1><a href="other-page.html">Other Page</a><hr/><h2>webpack.config.js</h2><pre>
<!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="main.js"></script></head><body><h1>Hello world!</h1><a href="other-page.html">Other Page</a><hr/><h2>webpack.config.js</h2><pre>
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackPartialsPlugin = require('../../');
Expand Down Expand Up @@ -42,4 +42,4 @@
...and the rest of this configuration example
</pre><h2>partials/other-body.html</h2><pre>
&#x3C;h1&#x3E;Hello other world!&#x3C;/h1&#x3E;
</pre><script src="main.js"></script></body></html>
</pre></body></html>
2 changes: 1 addition & 1 deletion examples/basic-multi/dist/main.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){console.log("Test!")}]);
console.log("Test!");
2 changes: 1 addition & 1 deletion examples/basic-multi/dist/other-page.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html><head></head><body><h1>Hello other world!</h1><script src="main.js"></script></body></html>
<!doctype html><html><head><script defer="defer" src="main.js"></script></head><body><h1>Hello other world!</h1></body></html>
4 changes: 2 additions & 2 deletions examples/basic/dist/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!doctype html><html><head><meta charset="utf-8"><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"></head><body><h1>Hello world!</h1><hr/><h2>webpack.config.js</h2><pre>
<!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="main.js"></script></head><body><h1>Hello world!</h1><hr/><h2>webpack.config.js</h2><pre>
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackPartialsPlugin = require('../../');
Expand All @@ -23,4 +23,4 @@
</pre><h2>partials/body.html</h2><pre>
&#x3C;h1&#x3E;Hello world!&#x3C;/h1&#x3E;
...and the rest of this configuration example
</pre><script src="main.js"></script></body></html>
</pre></body></html>
2 changes: 1 addition & 1 deletion examples/basic/dist/main.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){console.log("Test!")}]);
console.log("Test!");
4 changes: 2 additions & 2 deletions examples/body-attribute/dist/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<html><head><title>Custom Webpack Template</title></head><body><nav>I am the nav!</nav><h1>Hello world!</h1><hr/><h2>webpack.config.js</h2><pre>
<html><head><title>Custom Webpack Template</title><script defer="defer" src="main.js"></script></head><body><nav>I am the nav!</nav><h1>Hello world!</h1><hr/><h2>webpack.config.js</h2><pre>
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackPartialsPlugin = require('../../');
Expand Down Expand Up @@ -30,4 +30,4 @@
</pre><h2>partials/body.html</h2><pre>
&#x3C;h1&#x3E;Hello world!&#x3C;/h1&#x3E;
...and the rest of this configuration example
</pre><script src="main.js"></script></body></html>
</pre></body></html>
2 changes: 1 addition & 1 deletion examples/body-attribute/dist/main.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){console.log("Test!")}]);
console.log("Test!");
2 changes: 1 addition & 1 deletion examples/custom-multi-template-filename/dist/index.html
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><h1>Hello mad world!</h1><script src="main.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="main.js"></script></head><body><h1>Hello mad world!</h1></body></html>
2 changes: 1 addition & 1 deletion examples/custom-multi-template-filename/dist/main.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){console.log("Test!")}]);
console.log("Test!");
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html><head></head><body><h1>Hello mad world!</h1><script src="main.js"></script></body></html>
<!doctype html><html><head><script defer="defer" src="main.js"></script></head><body><h1>Hello mad world!</h1></body></html>
4 changes: 2 additions & 2 deletions examples/high-priority-head-no-meta/dist/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<html><head><style>h1 {
color: white;
background-color: #5F4B8B;
}</style><title>Custom Webpack Template</title></head><body><header>HTMLHeadElement</header><h1>Hello world!</h1><hr/><h2>webpack.config.js</h2><pre>
}</style><title>Custom Webpack Template</title><script defer="defer" src="main.js"></script></head><body><header>HTMLHeadElement</header><h1>Hello world!</h1><hr/><h2>webpack.config.js</h2><pre>
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackPartialsPlugin = require('../../');
Expand Down Expand Up @@ -35,4 +35,4 @@
</pre><h2>partials/body.html</h2><pre>
&#x3C;h1&#x3E;Hello world!&#x3C;/h1&#x3E;
...and the rest of this configuration example
</pre><script src="main.js"></script></body></html>
</pre></body></html>
2 changes: 1 addition & 1 deletion examples/high-priority-head-no-meta/dist/main.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){console.log("Test!")}]);
console.log("Test!");
4 changes: 2 additions & 2 deletions examples/high-priority-head/dist/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype html><html><head><meta charset="utf-8"><style>h1 {
color: white;
background-color: #5F4B8B;
}</style><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"></head><body><h1>Hello world!</h1><hr/><h2>webpack.config.js</h2><pre>
}</style><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"><script defer="defer" src="main.js"></script></head><body><h1>Hello world!</h1><hr/><h2>webpack.config.js</h2><pre>
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackPartialsPlugin = require('html-webpack-partials-plugin');
Expand Down Expand Up @@ -38,4 +38,4 @@
background-color: #5F4B8B;
}
&#x3C;/style&#x3E;
</pre><script src="main.js"></script></body></html>
</pre></body></html>
2 changes: 1 addition & 1 deletion examples/high-priority-head/dist/main.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){console.log("Test!")}]);
console.log("Test!");
Binary file added examples/html-loader/dist/images/html5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/html-loader/dist/images/webpack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 65 additions & 6 deletions examples/html-loader/dist/index.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,80 @@
<!doctype html><html><head><meta charset="utf-8"><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"></head><body><h1>Hello world!</h1><h2>webpack.config.js</h2><img src="../images/webpack.png"><pre>
<!doctype html><html><head><meta charset="utf-8"><script defer="defer" src="main.js"></script></head><style>img{max-width:320px;height:auto}</style><body><h1>Hello world!</h1><hr/><h2>Image in template</h2><img src="images/html5.png"/><hr/><h2>Image in partial</h2><img src="images/webpack.png"/><hr/><h2>webpack.config.js</h2><pre>
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackPartialsPlugin = require('html-webpack-partials-plugin');
const HtmlWebpackPartialsPlugin = require('../../');

module.exports = {
entry: {
main: path.join(__dirname, './main.js')
},
output: {
path: path.join(__dirname, './dist'),
filename: '[name].js'
filename: '[name].js',
assetModuleFilename: 'images/[name][ext]',
},
plugins: [
new HtmlWebpackPlugin(),
new HtmlWebpackPlugin({
template: path.join(__dirname, './wrapper.html')
}),
new HtmlWebpackPartialsPlugin({
path: path.join(__dirname, './partials/body.html')
})
]
],
module: {
rules: [
{
test: /\.(html)$/,
use: {
loader: 'html-loader',
options: {
sources: {
list: [
{
tag: 'img',
attribute: 'src',
type: 'src',
}
]
}
}
}
}
]
}
};
</pre><script src="main.js"></script></body></html>
</pre><h2>main.js</h2><pre>
console.log('Test!');
</pre><h2>wrapper.html</h2><pre>
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=&quot;utf-8&quot;&gt;
&lt;/head&gt;
&lt;style&gt;
img{
max-width: 320px;
height: auto;
}
&lt;/style&gt;
&lt;body&gt;
&lt;h1&gt;Hello world!&lt;/h1&gt;

&lt;hr /&gt;

&lt;h2&gt;Image in template&lt;/h2&gt;

&lt;img src=&quot;./images/html5.png&quot; /&gt;

&lt;hr /&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre><h2>partials/body.html</h2><pre>
&lt;h2&gt;Image in partial&lt;/h2&gt;

&lt;img src=&quot;../images/webpack.png&quot; /&gt;

&lt;hr /&gt;

...and the rest of this configuration example
</pre></body></html>
2 changes: 1 addition & 1 deletion examples/html-loader/dist/main.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){console.log("Test!")}]);
console.log("Test!");
21 changes: 0 additions & 21 deletions examples/html-loader/dist/partial.html

This file was deleted.

Loading