Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve warning of conflict order #465

Merged
merged 3 commits into from Nov 22, 2019

Conversation

laysent
Copy link
Contributor

@laysent laysent commented Nov 20, 2019

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

Many issues have been raised related to the warning of mini-css-extract-plugin regarding the conflict of order (example: #382 and #250). For me, the warning is a bit confusing as it does not provide enough details of why it goes wrong.

In this PR, I am trying to provide more info about:

  • what module has been added to the css asset;
  • why adding this module creates warnings;
  • which chunks you should probably take a look into.

In current version, running the unit test will generate the following warning:

WARNING in chunk styles [mini-css-extract-plugin]
Conflicting order between:
* css xxx/css-loader/dist/cjs.js!./e1.css
* css xxx/css-loader/dist/cjs.js!./e2.css

In this PR version, running the unit test will generate the following warning:

WARNING in chunk styles [mini-css-extract-plugin]
Following module has been added:
 * css xxx/css-loader/dist/cjs.js!./e1.css
while this module as dependencies that haven't been added before:
 * css xxx/css-loader/dist/cjs.js!./e2.css (used previous to added module in chunk entry2)

Hopefully people seeing this warning will get an idea of checking the files in entry2, then put e2.css import later than e1.css import.

Breaking Changes

No breaking changes.

Additional Info

@jsf-clabot
Copy link

jsf-clabot commented Nov 20, 2019

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Nov 20, 2019

Codecov Report

Merging #465 into master will increase coverage by 0.42%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #465      +/-   ##
==========================================
+ Coverage   88.17%   88.59%   +0.42%     
==========================================
  Files           5        5              
  Lines         406      421      +15     
  Branches       86       90       +4     
==========================================
+ Hits          358      373      +15     
  Misses         46       46              
  Partials        2        2
Impacted Files Coverage Δ
src/index.js 88.15% <100%> (+0.9%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 50434b5...65bf958. Read the comment docs.

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Please accept CLA and add test case, thanks

@laysent
Copy link
Contributor Author

laysent commented Nov 20, 2019

Please accept CLA and add test case, thanks

@evilebottnawi Hi, I have added simple unit test for it and signed CLA. Also modified the phrase a little bit. Let me know if you have any suggestion.

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Please fix test for windows

@laysent
Copy link
Contributor Author

laysent commented Nov 21, 2019

Windows test has been fixed, while lint still fails. Seems to be an issue with prettier.

@alexander-akait
Copy link
Member

@laysent let's update lock file too (just remove old lock file and run again npm i)

@laysent
Copy link
Contributor Author

laysent commented Nov 21, 2019

@evilebottnawi updated! :-)

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Good job, thanks!

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

Successfully merging this pull request may close these issues.

None yet

4 participants