Fix sorting for webpack2

This commit is contained in:
Jan Nicklas 2016-03-22 19:04:55 +01:00
parent 831cbdecb8
commit fab60bed44
1 changed files with 7 additions and 0 deletions

View File

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