Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

feat: allow to log invalid orders as warnings instead of errors via option #81

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions index.js
Expand Up @@ -284,8 +284,9 @@ ExtractTextPlugin.prototype.apply = function(compiler) {
if(extractedChunk.modules.length) {
extractedChunk.modules.sort(function(a, b) {
if(isInvalidOrder(a, b)) {
compilation.errors.push(new OrderUndefinedError(a.getOriginalModule()));
compilation.errors.push(new OrderUndefinedError(b.getOriginalModule()));
var targetLog = options.relaxInvalidOrder ? compilation.warnings : compilation.errors;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could go hand in hand with the ignoreOrder option, instead of adding a new option

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to adapt the PR @michael-ciniawsky

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joscha Yep please go ahead, not 💯 my assumption is yet fully correct :)

targetLog.push(new OrderUndefinedError(a.getOriginalModule()));
targetLog.push(new OrderUndefinedError(b.getOriginalModule()));
}
return getOrder(a, b);
});
Expand Down