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; +}