From d5160fe05bdd7d475f0041ffabcab7f2016b6300 Mon Sep 17 00:00:00 2001 From: Jan Nicklas Date: Mon, 18 May 2015 14:28:02 +0200 Subject: [PATCH] Refactoring to support loaders --- .gitignore | 1 + default_index.html | 15 +- default_inject_index.html | 9 -- example/example.js | 1 + example/favicon.ico | Bin 0 -> 766 bytes example/webpack.config.js | 14 ++ html-webpack-plugin-entry.js | 2 + index.js | 264 +++++++++++++++++----------------- loader.js | 10 ++ package.json | 3 +- spec/HtmlWebpackPluginSpec.js | 43 ------ 11 files changed, 164 insertions(+), 198 deletions(-) delete mode 100644 default_inject_index.html create mode 100755 example/example.js create mode 100644 example/favicon.ico create mode 100755 example/webpack.config.js create mode 100644 html-webpack-plugin-entry.js create mode 100644 loader.js diff --git a/.gitignore b/.gitignore index b0a5c349..e89a4ff5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /node_modules/ /dist/ +example/dist diff --git a/default_index.html b/default_index.html index 69d33842..5ba181b9 100644 --- a/default_index.html +++ b/default_index.html @@ -1,18 +1,9 @@ - + - {%=o.htmlWebpackPlugin.options.title || 'Webpack App'%} - {% if (o.htmlWebpackPlugin.files.favicon) { %} - - {% } %} - {% for (var css in o.htmlWebpackPlugin.files.css) { %} - - {% } %} + {%=o.htmlWebpackPlugin.options.title %} - {% for (var chunk in o.htmlWebpackPlugin.files.chunks) { %} - - {% } %} - + \ No newline at end of file diff --git a/default_inject_index.html b/default_inject_index.html deleted file mode 100644 index 69679799..00000000 --- a/default_inject_index.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - {%=o.htmlWebpackPlugin.options.title || 'Webpack App'%} - - - - diff --git a/example/example.js b/example/example.js new file mode 100755 index 00000000..80372b04 --- /dev/null +++ b/example/example.js @@ -0,0 +1 @@ +document.body.innerHTML = 'Hello world!'; \ No newline at end of file diff --git a/example/favicon.ico b/example/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..be74abd69ad6a32de7375df13cab9354798e328f GIT binary patch literal 766 zcmc(dze~eV5XUd2fg&jH87YDYDQKxq1{4b-_ydP-wqS9vgGh17QXQQAwOE{VaBvi* zmu^z9t({y-&1ey8Y_x;?x+`BviV9;aRjMgZ8M*!jgkRrFqSI9;F zHyfX@Az|AvVmn~YWWZP`0&JWEY~BFm?*Vq}VD7&_%x%MP$p`D`4JMC!K|B7pt?Mmp zUJAB7rxMXS6=!P+AtLU9V)J#61WPxwipRXCHO{BJ`l{m53#=t97a!znv~vfmr|AaP zRGIT7#0FyJy3Z*hL{GQp-0TRhX8UzZ)+>%?mK0^goaX4Q;x