diff --git a/examples/appcache/dist/0714810ae3fb211173e2964249507195.png b/examples/appcache/dist/webpack-1/0714810ae3fb211173e2964249507195.png similarity index 100% rename from examples/appcache/dist/0714810ae3fb211173e2964249507195.png rename to examples/appcache/dist/webpack-1/0714810ae3fb211173e2964249507195.png diff --git a/examples/appcache/dist/bundle.js b/examples/appcache/dist/webpack-1/bundle.js similarity index 100% rename from examples/appcache/dist/bundle.js rename to examples/appcache/dist/webpack-1/bundle.js diff --git a/examples/appcache/dist/index.html b/examples/appcache/dist/webpack-1/index.html similarity index 100% rename from examples/appcache/dist/index.html rename to examples/appcache/dist/webpack-1/index.html diff --git a/examples/appcache/dist/manifest.appcache b/examples/appcache/dist/webpack-1/manifest.appcache similarity index 100% rename from examples/appcache/dist/manifest.appcache rename to examples/appcache/dist/webpack-1/manifest.appcache diff --git a/examples/appcache/dist/styles.css b/examples/appcache/dist/webpack-1/styles.css similarity index 100% rename from examples/appcache/dist/styles.css rename to examples/appcache/dist/webpack-1/styles.css diff --git a/examples/appcache/webpack.config.js b/examples/appcache/webpack.config.js index 503cc88..2d12791 100755 --- a/examples/appcache/webpack.config.js +++ b/examples/appcache/webpack.config.js @@ -1,10 +1,12 @@ var AppCachePlugin = require('appcache-webpack-plugin'); var HtmlWebpackPlugin = require('../..'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); +var webpackMajorVersion = require('webpack/package.json').version.split('.')[0]; + module.exports = { entry: './example.js', output: { - path: __dirname + '/dist', + path: __dirname + '/dist/webpack-' + webpackMajorVersion, publicPath: '', filename: 'bundle.js' }, @@ -28,4 +30,3 @@ module.exports = { new ExtractTextPlugin('styles.css') ] }; - diff --git a/examples/custom-template/dist/0714810ae3fb211173e2964249507195.png b/examples/custom-template/dist/webpack-1/0714810ae3fb211173e2964249507195.png similarity index 100% rename from examples/custom-template/dist/0714810ae3fb211173e2964249507195.png rename to examples/custom-template/dist/webpack-1/0714810ae3fb211173e2964249507195.png diff --git a/examples/custom-template/dist/bundle.js b/examples/custom-template/dist/webpack-1/bundle.js similarity index 100% rename from examples/custom-template/dist/bundle.js rename to examples/custom-template/dist/webpack-1/bundle.js diff --git a/examples/custom-template/dist/index.html b/examples/custom-template/dist/webpack-1/index.html similarity index 100% rename from examples/custom-template/dist/index.html rename to examples/custom-template/dist/webpack-1/index.html diff --git a/examples/custom-template/dist/styles.css b/examples/custom-template/dist/webpack-1/styles.css similarity index 100% rename from examples/custom-template/dist/styles.css rename to examples/custom-template/dist/webpack-1/styles.css diff --git a/examples/custom-template/webpack.config.js b/examples/custom-template/webpack.config.js index 967ddb2..d512d4a 100755 --- a/examples/custom-template/webpack.config.js +++ b/examples/custom-template/webpack.config.js @@ -1,9 +1,11 @@ var HtmlWebpackPlugin = require('../..'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); +var webpackMajorVersion = require('webpack/package.json').version.split('.')[0]; + module.exports = { entry: './example.js', output: { - path: __dirname + '/dist', + path: __dirname + '/dist/webpack-' + webpackMajorVersion, publicPath: '', filename: 'bundle.js' }, diff --git a/examples/default/dist/bundle.js b/examples/default/dist/webpack-1/bundle.js similarity index 100% rename from examples/default/dist/bundle.js rename to examples/default/dist/webpack-1/bundle.js diff --git a/examples/default/dist/index.html b/examples/default/dist/webpack-1/index.html similarity index 100% rename from examples/default/dist/index.html rename to examples/default/dist/webpack-1/index.html diff --git a/examples/default/webpack.config.js b/examples/default/webpack.config.js index 91326e3..2168e01 100755 --- a/examples/default/webpack.config.js +++ b/examples/default/webpack.config.js @@ -1,8 +1,9 @@ var HtmlWebpackPlugin = require('../..'); +var webpackMajorVersion = require('webpack/package.json').version.split('.')[0]; module.exports = { entry: './example.js', output: { - path: __dirname + '/dist', + path: __dirname + '/dist/webpack-' + webpackMajorVersion, publicPath: '', filename: 'bundle.js' }, diff --git a/examples/favicon/dist/bundle.js b/examples/favicon/dist/webpack-1/bundle.js similarity index 100% rename from examples/favicon/dist/bundle.js rename to examples/favicon/dist/webpack-1/bundle.js diff --git a/examples/favicon/dist/favicon.html b/examples/favicon/dist/webpack-1/favicon.html similarity index 100% rename from examples/favicon/dist/favicon.html rename to examples/favicon/dist/webpack-1/favicon.html diff --git a/examples/favicon/dist/favicon.ico b/examples/favicon/dist/webpack-1/favicon.ico similarity index 100% rename from examples/favicon/dist/favicon.ico rename to examples/favicon/dist/webpack-1/favicon.ico diff --git a/examples/favicon/dist/styles.css b/examples/favicon/dist/webpack-1/styles.css similarity index 100% rename from examples/favicon/dist/styles.css rename to examples/favicon/dist/webpack-1/styles.css diff --git a/examples/favicon/webpack.config.js b/examples/favicon/webpack.config.js index 61e29b6..ec93c95 100755 --- a/examples/favicon/webpack.config.js +++ b/examples/favicon/webpack.config.js @@ -1,9 +1,10 @@ var HtmlWebpackPlugin = require('../..'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); +var webpackMajorVersion = require('webpack/package.json').version.split('.')[0]; module.exports = { entry: './example.js', output: { - path: __dirname + '/dist', + path: __dirname + '/dist/webpack-' + webpackMajorVersion, publicPath: '', filename: 'bundle.js' }, diff --git a/examples/html-loader/dist/0714810ae3fb211173e2964249507195.png b/examples/html-loader/dist/webpack-1/0714810ae3fb211173e2964249507195.png similarity index 100% rename from examples/html-loader/dist/0714810ae3fb211173e2964249507195.png rename to examples/html-loader/dist/webpack-1/0714810ae3fb211173e2964249507195.png diff --git a/examples/html-loader/dist/about.html b/examples/html-loader/dist/webpack-1/about.html similarity index 100% rename from examples/html-loader/dist/about.html rename to examples/html-loader/dist/webpack-1/about.html diff --git a/examples/html-loader/dist/bundle.js b/examples/html-loader/dist/webpack-1/bundle.js similarity index 100% rename from examples/html-loader/dist/bundle.js rename to examples/html-loader/dist/webpack-1/bundle.js diff --git a/examples/html-loader/dist/favicon.ico b/examples/html-loader/dist/webpack-1/favicon.ico similarity index 100% rename from examples/html-loader/dist/favicon.ico rename to examples/html-loader/dist/webpack-1/favicon.ico diff --git a/examples/html-loader/dist/index.html b/examples/html-loader/dist/webpack-1/index.html similarity index 100% rename from examples/html-loader/dist/index.html rename to examples/html-loader/dist/webpack-1/index.html diff --git a/examples/html-loader/dist/styles.css b/examples/html-loader/dist/webpack-1/styles.css similarity index 100% rename from examples/html-loader/dist/styles.css rename to examples/html-loader/dist/webpack-1/styles.css diff --git a/examples/html-loader/webpack.config.js b/examples/html-loader/webpack.config.js index cbeee16..6d0a435 100755 --- a/examples/html-loader/webpack.config.js +++ b/examples/html-loader/webpack.config.js @@ -1,9 +1,10 @@ var HtmlWebpackPlugin = require('../..'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); +var webpackMajorVersion = require('webpack/package.json').version.split('.')[0]; module.exports = { entry: './example.js', output: { - path: __dirname + '/dist', + path: __dirname + '/dist/webpack-' + webpackMajorVersion, publicPath: '', filename: 'bundle.js' }, diff --git a/examples/jade-loader/dist/0714810ae3fb211173e2964249507195.png b/examples/jade-loader/dist/webpack-1/0714810ae3fb211173e2964249507195.png similarity index 100% rename from examples/jade-loader/dist/0714810ae3fb211173e2964249507195.png rename to examples/jade-loader/dist/webpack-1/0714810ae3fb211173e2964249507195.png diff --git a/examples/jade-loader/dist/bundle.js b/examples/jade-loader/dist/webpack-1/bundle.js similarity index 100% rename from examples/jade-loader/dist/bundle.js rename to examples/jade-loader/dist/webpack-1/bundle.js diff --git a/examples/jade-loader/dist/favicon.ico b/examples/jade-loader/dist/webpack-1/favicon.ico similarity index 100% rename from examples/jade-loader/dist/favicon.ico rename to examples/jade-loader/dist/webpack-1/favicon.ico diff --git a/examples/jade-loader/dist/index.html b/examples/jade-loader/dist/webpack-1/index.html similarity index 100% rename from examples/jade-loader/dist/index.html rename to examples/jade-loader/dist/webpack-1/index.html diff --git a/examples/jade-loader/dist/styles.css b/examples/jade-loader/dist/webpack-1/styles.css similarity index 100% rename from examples/jade-loader/dist/styles.css rename to examples/jade-loader/dist/webpack-1/styles.css diff --git a/examples/jade-loader/webpack.config.js b/examples/jade-loader/webpack.config.js index 3d27453..ed3d56f 100755 --- a/examples/jade-loader/webpack.config.js +++ b/examples/jade-loader/webpack.config.js @@ -1,9 +1,10 @@ var HtmlWebpackPlugin = require('../..'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); +var webpackMajorVersion = require('webpack/package.json').version.split('.')[0]; module.exports = { entry: './example.js', output: { - path: __dirname + '/dist', + path: __dirname + '/dist/webpack-' + webpackMajorVersion, publicPath: '', filename: 'bundle.js' }, diff --git a/examples/javascript-advanced/dist/0714810ae3fb211173e2964249507195.png b/examples/javascript-advanced/dist/webpack-1/0714810ae3fb211173e2964249507195.png similarity index 100% rename from examples/javascript-advanced/dist/0714810ae3fb211173e2964249507195.png rename to examples/javascript-advanced/dist/webpack-1/0714810ae3fb211173e2964249507195.png diff --git a/examples/javascript-advanced/dist/bundle.js b/examples/javascript-advanced/dist/webpack-1/bundle.js similarity index 100% rename from examples/javascript-advanced/dist/bundle.js rename to examples/javascript-advanced/dist/webpack-1/bundle.js diff --git a/examples/javascript-advanced/dist/index.html b/examples/javascript-advanced/dist/webpack-1/index.html similarity index 100% rename from examples/javascript-advanced/dist/index.html rename to examples/javascript-advanced/dist/webpack-1/index.html diff --git a/examples/javascript-advanced/dist/styles.css b/examples/javascript-advanced/dist/webpack-1/styles.css similarity index 100% rename from examples/javascript-advanced/dist/styles.css rename to examples/javascript-advanced/dist/webpack-1/styles.css diff --git a/examples/javascript-advanced/webpack.config.js b/examples/javascript-advanced/webpack.config.js index e0d314e..a964787 100644 --- a/examples/javascript-advanced/webpack.config.js +++ b/examples/javascript-advanced/webpack.config.js @@ -1,9 +1,10 @@ var HtmlWebpackPlugin = require('../..'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); +var webpackMajorVersion = require('webpack/package.json').version.split('.')[0]; module.exports = { entry: './example.js', output: { - path: __dirname + '/dist', + path: __dirname + '/dist/webpack-' + webpackMajorVersion, publicPath: '', filename: 'bundle.js' }, diff --git a/examples/javascript/dist/0714810ae3fb211173e2964249507195.png b/examples/javascript/dist/webpack-1/0714810ae3fb211173e2964249507195.png similarity index 100% rename from examples/javascript/dist/0714810ae3fb211173e2964249507195.png rename to examples/javascript/dist/webpack-1/0714810ae3fb211173e2964249507195.png diff --git a/examples/javascript/dist/bundle.js b/examples/javascript/dist/webpack-1/bundle.js similarity index 100% rename from examples/javascript/dist/bundle.js rename to examples/javascript/dist/webpack-1/bundle.js diff --git a/examples/javascript/dist/index.html b/examples/javascript/dist/webpack-1/index.html similarity index 64% rename from examples/javascript/dist/index.html rename to examples/javascript/dist/webpack-1/index.html index d1d7cd9..f4f3e23 100644 --- a/examples/javascript/dist/index.html +++ b/examples/javascript/dist/webpack-1/index.html @@ -1,2 +1,2 @@ -
Hello World from backend2016-01-20T15:46:57.631Z
\ No newline at end of file
diff --git a/examples/javascript/dist/styles.css b/examples/javascript/dist/webpack-1/styles.css
similarity index 100%
rename from examples/javascript/dist/styles.css
rename to examples/javascript/dist/webpack-1/styles.css
diff --git a/examples/javascript/webpack.config.js b/examples/javascript/webpack.config.js
index e0d314e..a964787 100644
--- a/examples/javascript/webpack.config.js
+++ b/examples/javascript/webpack.config.js
@@ -1,9 +1,10 @@
var HtmlWebpackPlugin = require('../..');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
+var webpackMajorVersion = require('webpack/package.json').version.split('.')[0];
module.exports = {
entry: './example.js',
output: {
- path: __dirname + '/dist',
+ path: __dirname + '/dist/webpack-' + webpackMajorVersion,
publicPath: '',
filename: 'bundle.js'
},
diff --git a/spec/ExampleSpec.js b/spec/ExampleSpec.js
index aec6f56..192f540 100644
--- a/spec/ExampleSpec.js
+++ b/spec/ExampleSpec.js
@@ -16,19 +16,24 @@ var path = require('path');
var webpack = require('webpack');
var rm_rf = require('rimraf');
var fs = require('fs');
+var webpackMajorVersion = require('webpack/package.json').version.split('.')[0];
var OUTPUT_DIR = path.join(__dirname, '../dist');
+jasmine.getEnv().defaultTimeoutInterval = 5000;
+
function runExample (exampleName, done) {
var examplePath = path.resolve(__dirname, '..', 'examples', exampleName);
var exampleOutput = path.join(OUTPUT_DIR, exampleName);
+ var fixturePath = path.join(examplePath, 'dist', 'webpack-' + webpackMajorVersion);
+ // Clear old results
rm_rf(exampleOutput, function () {
var options = require(path.join(examplePath, 'webpack.config.js'));
options.context = examplePath;
options.output.path = exampleOutput;
webpack(options, function (err) {
var dircompare = require('dir-compare');
- var res = dircompare.compareSync(path.join(examplePath, 'dist'), exampleOutput, {compareSize: true});
+ var res = dircompare.compareSync(fixturePath, exampleOutput, {compareSize: true});
res.diffSet.filter(function (diff) {
return diff.state === 'distinct';