From ba2a590ae41dec199b87dab80df55b822e4484a7 Mon Sep 17 00:00:00 2001 From: Jan Nicklas Date: Wed, 9 Sep 2015 12:07:14 +0200 Subject: [PATCH 1/5] Add 2.0 installation instructions to readme --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index dca91a7..c9fb7cf 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,12 @@ Install the plugin with npm: $ npm install html-webpack-plugin --save-dev ``` +There is also a [2.0 beta branch](https://github.com/ampedandwired/html-webpack-plugin/tree/feature/loaders) which allows using loaders for templates. +For further information on the 2.0 see its [pull-request](https://github.com/ampedandwired/html-webpack-plugin/pull/41) +```shell +$ npm install html-webpack-plugin@2 --save-dev +``` + Basic Usage ----------- From 941e8fb7cd8eb962a3876f6907724f3fa5abf820 Mon Sep 17 00:00:00 2001 From: Jan Nicklas Date: Wed, 9 Sep 2015 12:09:57 +0200 Subject: [PATCH 2/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c9fb7cf..7e4323f 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ $ npm install html-webpack-plugin --save-dev ``` There is also a [2.0 beta branch](https://github.com/ampedandwired/html-webpack-plugin/tree/feature/loaders) which allows using loaders for templates. -For further information on the 2.0 see its [pull-request](https://github.com/ampedandwired/html-webpack-plugin/pull/41) +For further information on 2.0 see the according [pull-request](https://github.com/ampedandwired/html-webpack-plugin/pull/41) ```shell $ npm install html-webpack-plugin@2 --save-dev ``` From 4809fa5804a800ec0b1b7440dbe53293ce6279d2 Mon Sep 17 00:00:00 2001 From: Oleksandr Khomenko Date: Mon, 14 Sep 2015 16:15:52 -0500 Subject: [PATCH 3/5] Fixed 2 tests on windows. Resolve web urls properly with node url module --- index.js | 5 ++++- spec/HtmlWebpackPluginSpec.js | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index f014fc8..25875e8 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,7 @@ 'use strict'; var fs = require('fs'); var path = require('path'); + var urlModule = require('url'); var _ = require('lodash'); var tmpl = require('blueimp-tmpl').tmpl; var Promise = require('bluebird'); @@ -101,6 +102,8 @@ HtmlWebpackPlugin.prototype.getTemplateContent = function(compilation, templateP if (!templateFile) { // Use a special index file to prevent double script / style injection if the `inject` option is truthy templateFile = path.join(__dirname, self.options.inject ? 'default_inject_index.html' : 'default_index.html'); + } else { + templateFile = path.join(templateFile); } compilation.fileDependencies.push(templateFile); return fs.readFileAsync(templateFile, 'utf8') @@ -176,7 +179,7 @@ HtmlWebpackPlugin.prototype.htmlWebpackPluginAssets = function(compilation, webp path.relative(path.dirname(self.options.filename), '.'); if (publicPath.length && publicPath.substr(-1, 1) !== '/') { - publicPath += '/'; + publicPath = urlModule.resolve(publicPath + '/', '.') + '/'; } var assets = { diff --git a/spec/HtmlWebpackPluginSpec.js b/spec/HtmlWebpackPluginSpec.js index a8bde34..4a0ccbe 100644 --- a/spec/HtmlWebpackPluginSpec.js +++ b/spec/HtmlWebpackPluginSpec.js @@ -114,6 +114,23 @@ describe('HtmlWebpackPlugin', function() { }, ['