Skip to content

Commit

Permalink
Applied workaround provided in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
editedredx committed Sep 11, 2017
1 parent e81b883 commit 2b5cdd4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,12 @@ ExtractTextPlugin.prototype.apply = function(compiler) {
compilation.plugin("additional-assets", function(callback) {
extractedChunks.forEach(function(extractedChunk) {
if(extractedChunk.modules.length) {
extractedChunk.modules.sort(function(a, b) {
// HACK: Fix the CSS ordering issue present in 2.1.2 without needing to move to
// version 3.0.0 which breaks reloading in webpack-dev-server.
// See:
// https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/548
// https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/579
extractedChunk.modules = extractedChunk.modules.sort(function(a, b) {
if(!options.ignoreOrder && isInvalidOrder(a, b)) {
compilation.errors.push(new OrderUndefinedError(a.getOriginalModule()));
compilation.errors.push(new OrderUndefinedError(b.getOriginalModule()));
Expand All @@ -337,7 +342,7 @@ ExtractTextPlugin.prototype.apply = function(compiler) {
});

var file = (isFunction(filename)) ? filename(getPath) : getPath(filename);

compilation.assets[file] = source;
chunk.files.push(file);
}
Expand Down

0 comments on commit 2b5cdd4

Please sign in to comment.