-
Notifications
You must be signed in to change notification settings - Fork 512
refactor: Apply webpack-defaults & webpack 3.x support #540
Conversation
This is recommended after webpack/webpack#4704
package.json
Outdated
| "standard-version": "^4.1.0", | ||
| "style-loader": "^0.18.2", | ||
| "webpack": "^2.6.1" | ||
| "webpack": "^3.0.0-rc.0" |
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.
^3.0.0
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.
This is removed in #542
|
@d3viant0ne Would this be ready as a MVP ? |
peerDependencies (webpack v2.0.0..3.0.0)
|
|
peerDependencies (webpack v2.0.0..3.0.0)
Codecov Report
@@ Coverage Diff @@
## master #540 +/- ##
==========================================
- Coverage 90.14% 87.41% -2.73%
==========================================
Files 4 7 +3
Lines 355 302 -53
Branches 75 68 -7
==========================================
- Hits 320 264 -56
- Misses 35 36 +1
- Partials 0 2 +2
Continue to review full report at Codecov.
|
src/index.js
Outdated
| compilation.plugin('additional-assets', (callback) => { | ||
| extractedChunks.forEach((extractedChunk) => { | ||
| if (extractedChunk.getNumberOfModules()) { | ||
| extractedChunk.modules.sort((a, b) => { |
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.
extractedChunk.modules.sort => extractedChunk.sortModules ?
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.
Think we have the same idea, we'll know in a minute.
5813cc7 to
27e3a28
Compare
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.
If it stays family friendly over the weekend g2g 😛
src/index.js
Outdated
| async.forEach(chunks, (chunk, callback) => { // eslint-disable-line no-shadow | ||
| const extractedChunk = extractedChunks[chunks.indexOf(chunk)]; | ||
| const shouldExtract = !!(options.allChunks || isInitialOrHasNoParents(chunk)); | ||
| chunk.sortModules(module); |
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.
I'm seeing #565 in a webpack project at $WORK. I don't think you should be passing in module to sortModules (since it doesn't seem to be a comparator function) and making this change fixes the aforementioned problem for me.
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.
Can you provide more info about your setup please? webpack.config.js etc ? Do you use karma somewhere (#554) ?
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.
No, we don't use karma anywhere. I can try and scrub the config so I can post it, but it will be a bit of a pain.
This particular reference is to Node's current module object since there are no other references to module in this scope (from what I can tell anyway). Is the sort intended to be called during mapModules?
|
For everyone watching, I'll be publishing what should be the final rc build shortly. Still planning on putting this on the |
Codecov Report
@@ Coverage Diff @@
## master #540 +/- ##
==========================================
- Coverage 90.14% 87.41% -2.73%
==========================================
Files 4 7 +3
Lines 355 302 -53
Branches 75 68 -7
==========================================
- Hits 320 264 -56
- Misses 35 36 +1
- Partials 0 2 +2
Continue to review full report at Codecov.
|
Working PR for the 3.x release branch
chunk.modulesfrom Use a Set to store modules in a chunk webpack/webpack#4764 refactor:Chunk.modules=>Chunk.mapModules(webpack v3.0.0) #543webpack-defaultstooling updates refactor: Apply webpack-defaults #542webpack-defaultsgrammar updates refactor: Apply webpack-defaults #542webpack-defaultsstyle updates refactor: Apply webpack-defaults #542webpackdevDependency refactor: Apply webpack-defaults #542single argumentdeprecations from 2.x refactor: Apply webpack-defaults #542Installsection of readme with last published 2.x versionBeta & RC builds should be published from this branch to the
@betanpmdist-tagCloses #529
Closes #548