From 796bcbe19cdd68a25bd7fa770d8dab00f0411802 Mon Sep 17 00:00:00 2001 From: Jan Nicklas Date: Mon, 23 Nov 2015 14:13:32 +0100 Subject: [PATCH] Add unit tests for chunk sort --- spec/HtmlWebpackPluginSpec.js | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/spec/HtmlWebpackPluginSpec.js b/spec/HtmlWebpackPluginSpec.js index 3434a7f..2bd8571 100644 --- a/spec/HtmlWebpackPluginSpec.js +++ b/spec/HtmlWebpackPluginSpec.js @@ -626,4 +626,50 @@ describe('HtmlWebpackPlugin', function() { }, ['Error: HtmlWebpackPlugin: could not load file'], null, done, true); }); + it('should short the chunks', function(done) { + testHtmlPlugin({ + entry: { + util: path.join(__dirname, 'fixtures/util.js'), + index: path.join(__dirname, 'fixtures/index.js') + }, + output: { + path: OUTPUT_DIR, + filename: '[name]_bundle.js' + }, + plugins: [ + new CommonsChunkPlugin({ + name: 'common', + filename: "common_bundle.js", + }), + new HtmlWebpackPlugin({ + chunksSortMode: 'auto' + }) + ] + }, [ + /