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

Conversation

p0wl
Copy link

@p0wl p0wl commented Jul 3, 2015

When migrating from a large legacy codebase to Webpack, we noticed that many of our CSS group definitions have inconsistent ordering. After trying to fix that ordering for a while, we found out that it was actually not that simple. Especially because the order might be deliberately different per entry-point and there was no way of knowing that without asking the author(s) of the respective CSS group.
The build with the extract-text-plugin would still generate the correct (in the sense of the definition given by the developers) output, except the CI would fail because webpack would exit with a non-zero state because of the order "errors".
Therefore we introduced an option to the plugin that allows us to degrade those errors to warnings, which makes the developers aware of their inconsistent ordering without breaking the CI build immediately.

fixes #80

cc @joscha

@joscha joscha mentioned this pull request Jul 5, 2015
@p0wl
Copy link
Author

p0wl commented Jul 24, 2015

any objections @sokra?

@p0wl
Copy link
Author

p0wl commented Jan 7, 2016

we really would like to see this merged. can you please have a look?

@christian-meyer-jimdo
Copy link

👍

@joshwiens joshwiens force-pushed the master branch 2 times, most recently from 664e78c to 76a171d Compare January 28, 2017 22:40
@bebraw bebraw added this to the 2.1 features/fixes milestone Jan 29, 2017
@michael-ciniawsky michael-ciniawsky changed the title allow to log invalid orders as warnings instead of errors via option feat: allow to log invalid orders as warnings instead of errors via option Apr 22, 2017
@@ -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 :)

@michael-ciniawsky
Copy link
Member

michael-ciniawsky commented Jul 7, 2017

We are close to a major release, currently in beta npm i -D extract-text-webpack-plugin@beta and therefore I will close this PR here, feel free to open a new PR with this changes, when #540 landed on master

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chunks option
6 participants