-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Upgrade webpack to version 5 #26382
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 webpack to version 5 #26382
Changes from all commits
1c5c023
5612e7d
51cce2a
fd9b164
73513a9
d8854c3
39f91f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,6 +87,7 @@ module.exports = { | |
], | ||
}, | ||
mode, | ||
target: 'browserslist', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume we will need to apply the same changes in the shared config in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, at this moment, this doesn't even have the desired effect because webpack/webpack#11754 wasn't released yet. So it's hard to test properly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A month later, |
||
entry: gutenbergPackages.reduce( ( memo, packageName ) => { | ||
const name = camelCaseDash( packageName ); | ||
memo[ name ] = `./packages/${ packageName }`; | ||
|
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 surprised it works with webpack 5. It's the hackiest plugin we created to this date 😅
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.
It's a very simple one though 🙂
The plugin may be not needed at all: webpack already has an
output: { libraryExport: 'default' }
option that does the same thing. And the implementation is very similar to yours -- just append.default
at the end 🙂.The only caveat is that we want to export the
default
only for certain libraries/entrypoints, while the option is global 🙁