-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
Upgrade to css-minimize-webpack-plugin 2.0 #966
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this Stof!
I think we need to also remove our sourceMap
option here -
sourceMap: webpackConfig.useSourceMaps |
This would be the first time (since our 1.0) that we would upgrade dependencies over a major version. That's a gray area in our BC policy. The changes, in this case, are not for any options, etc that are used (or advertised to be used, e.g. in index.js
documentation) by Encore. Therefore, my opinion is that it does not require a major a bump (and I think you agree).
This upgrades cssnano to version 5, which fixes a bunch of bugs and uses postcss 8 (avoiding to install multiple versions of postcss).
adb5ca5
to
a8eb4c8
Compare
a8eb4c8
to
325bf18
Compare
For fixing the tests, I went the lazy way for finding the version of webpack that changed the naming of chunks, and I made 5.35 (the current version) the min version. I know that 5.25 is still using the old naming of the split chunk. Due to the way yarn and npm work, supporting a wide range of versions for |
ok, apparently, it is not webpack itself changing the naming of chunks, but probably a plugin... |
@weaverryan how do you generally fix this issue about the generated chunk ids being different for the lowest deps job ? |
I have been, on a case-by-case basis, making our test suite able to be "smarter" by matching in a fuzzy way. For example: webpack-encore/test/functional.js Line 444 in d074101
Outside of this PR, we just need to find the new problems and make them fuzzy like this :) |
@@ -101,11 +101,12 @@ module.exports = Encore.getWebpackConfig(); | |||
expect(parsedOutput).to.be.an('object'); | |||
expect(parsedOutput.modules).to.be.an('array'); | |||
|
|||
// We expect 3 modules there: | |||
// We expect 4 modules there: | |||
// - webpack/runtime/chunk loaded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this related to the babel-loader bump? V 8.2.2
causes an extra module to be in here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
webpack itself. They refactored their runtime in the 5.25 release
@weaverryan the issue is the test about splitting entry points in production mode. there, the file names are integers generated by webpack, and they depend on a bunch of things |
👍 So, for reference, this line causes problems:
Matching the 2 integers in a "fuzzy" way would be a little odd... just because they could be anything. The test would be reduced to:
It makes me think it would be easier just to rewrite the test. Instead of asserting the entire entrypoints.json contents, we would check specifically for the two items above (check for 4 files, and that two of them are runtime.js and main.js). For the |
@weaverryan any chance that you do the refactoring of this test, as you know better than me the architecture of the testsuite ? |
No problem - I was thinking already about doing that - I pushed a commit that should hopefully do the trick :) |
Looks like the |
I noticed that too :/ - I'll take a look at it in a separate PR - the cause is not immediately obvious |
Thanks Stof! |
Thanks! :) |
This upgrades cssnano to version 5, which fixes a bunch of bugs and uses postcss 8 (avoiding to install multiple versions of postcss).
The BC breaks in the plugin are dropping support for webpack 4 (not impacted Encore as we already dropped it), removing some options which were only for webpack 4 and the fact that cssnano 5 requires node 10.13+ (not impacting Encore as we already require 10.19+)
Closes #965