extract-text-webpack-plugin
Advanced tools
Comparing version 0.7.1 to 0.8.0
35
index.js
@@ -74,11 +74,17 @@ /* | ||
function getOrder(a, b) { | ||
function isInvalidOrder(a, b) { | ||
var bBeforeA = a.getPrevModules().indexOf(b) >= 0; | ||
var aBeforeB = b.getPrevModules().indexOf(a) >= 0; | ||
if(aBeforeB && bBeforeA) | ||
return NaN; | ||
if(bBeforeA) | ||
return 1; | ||
if(aBeforeB) | ||
return -1; | ||
return aBeforeB && bBeforeA; | ||
} | ||
function getOrder(a, b) { | ||
var aIndex = a.getOriginalModule().index2; | ||
var bIndex = b.getOriginalModule().index2; | ||
if(aIndex < bIndex) return -1; | ||
if(aIndex > bIndex) return 1; | ||
var ai = a.identifier(); | ||
var bi = b.identifier(); | ||
if(ai < bi) return -1; | ||
if(ai > bi) return 1; | ||
return 0; | ||
@@ -200,2 +206,4 @@ } | ||
extractedChunk.name = chunk.name; | ||
extractedChunk.entry = chunk.entry; | ||
extractedChunk.initial = chunk.initial; | ||
chunk.chunks.forEach(function(c) { | ||
@@ -268,16 +276,7 @@ extractedChunk.addChunk(extractedChunks[chunks.indexOf(c)]); | ||
extractedChunk.modules.sort(function(a, b) { | ||
var order = getOrder(a, b); | ||
if(isNaN(order)) { | ||
if(isInvalidOrder(a, b)) { | ||
compilation.errors.push(new OrderUndefinedError(a.getOriginalModule())); | ||
compilation.errors.push(new OrderUndefinedError(b.getOriginalModule())); | ||
} | ||
if(order !== 0 && !isNaN(order)) | ||
return order; | ||
var ai = a.identifier(); | ||
var bi = b.identifier(); | ||
if(ai < bi) | ||
return -1; | ||
if(ai > bi) | ||
return 1; | ||
return 0; | ||
return getOrder(a, b); | ||
}); | ||
@@ -284,0 +283,0 @@ var chunk = extractedChunk.originalChunk; |
{ | ||
"name": "extract-text-webpack-plugin", | ||
"version": "0.7.1", | ||
"version": "0.8.0", | ||
"author": "Tobias Koppers @sokra", | ||
"description": "Extract text from bundle into a file.", | ||
"peerDependencies": { | ||
"webpack": "^1.4.2" | ||
"webpack": "^1.9.4" | ||
}, | ||
@@ -9,0 +9,0 @@ "dependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19824
455