From fab60bed44cd4e2c542c18e5889fd902e5e2458f Mon Sep 17 00:00:00 2001 From: Jan Nicklas Date: Tue, 22 Mar 2016 19:04:55 +0100 Subject: [PATCH] Fix sorting for webpack2 --- lib/chunksorter.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/chunksorter.js b/lib/chunksorter.js index ca8753e..16a73e1 100644 --- a/lib/chunksorter.js +++ b/lib/chunksorter.js @@ -81,3 +81,10 @@ module.exports.none = function (chunks) { * Defines the default sorter. */ module.exports.auto = module.exports.id; + +// In webpack 2 the ids are fliped around. +// Therefore the id sort is broken +// Luckily the dependency sort is working as expected +if (require('webpack/package.json').version.split('.')[0] === '2') { + module.exports.auto = module.exports.dependency; +}