Skip to content

Commit 2b5cdd4

Browse files
committed
Applied workaround provided in comments
webpack-contrib#579 (comment)
1 parent e81b883 commit 2b5cdd4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,12 @@ ExtractTextPlugin.prototype.apply = function(compiler) {
320320
compilation.plugin("additional-assets", function(callback) {
321321
extractedChunks.forEach(function(extractedChunk) {
322322
if(extractedChunk.modules.length) {
323-
extractedChunk.modules.sort(function(a, b) {
323+
// HACK: Fix the CSS ordering issue present in 2.1.2 without needing to move to
324+
// version 3.0.0 which breaks reloading in webpack-dev-server.
325+
// See:
326+
// https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/548
327+
// https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/579
328+
extractedChunk.modules = extractedChunk.modules.sort(function(a, b) {
324329
if(!options.ignoreOrder && isInvalidOrder(a, b)) {
325330
compilation.errors.push(new OrderUndefinedError(a.getOriginalModule()));
326331
compilation.errors.push(new OrderUndefinedError(b.getOriginalModule()));
@@ -337,7 +342,7 @@ ExtractTextPlugin.prototype.apply = function(compiler) {
337342
});
338343

339344
var file = (isFunction(filename)) ? filename(getPath) : getPath(filename);
340-
345+
341346
compilation.assets[file] = source;
342347
chunk.files.push(file);
343348
}

0 commit comments

Comments
 (0)