-
Notifications
You must be signed in to change notification settings - Fork 604
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
[heft] Create a Webpack 5 plugin. #2594
Conversation
05bbe19
to
0ee4531
Compare
'https://rushstack.io/pages/heft_tasks/webpack/' | ||
'"@rushstack/heft-webpack4-plugin" or "@rushstack/heft-webpack5-plugin" to ' + | ||
'your package.json devDependencies and use config/heft.json to load it. ' + | ||
'For details, see this documentation: https://rushstack.io/pages/heft_tasks/webpack/' |
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.
Just curious -- what would happen if someone accidentally loaded BOTH plugins? (For example the project loads Webpack 4 but the rig loads Webpack 5)
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.
You'll get a A plugin with name "WebpackPlugin" has already been applied
error. We can eventually clean that error up, but I wouldn't consider that a high priority.
9cfefed
to
02309c1
Compare
02309c1
to
4f7bc3e
Compare
…s of two different versions of the webpack typings.
4f7bc3e
to
eccdf31
Compare
eccdf31
to
0226482
Compare
new Error( | ||
`The Webpack plugin expected to be configured with webpack-dev-server version ${webpackVersions.webpackDevServerVersion}, ` + | ||
`but the configuration specifies version ${bundleSubstageProperties.webpackDevServerVersion}. ` + | ||
'Are multiple versions of the Webpack plugin present?' |
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.
Multiple versions of the webpack plugin should be an allowed scenario and may well be something a developer would want to do, hence why "configureWebpack" should be a hook on the webpack plugin instance, or on an "IWebpackPluginHooks" object, obtained by WebpackPlugin.getHooks(heftSession)
, not on the bundle substage.
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 super curious what the use case is for multiple webpack versions?
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.
Backwards compatibility is the main reason I can think of. Building both so that you can compare the outputs between the two side by side, especially during upgrade.
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.
very interesting. i would have never considered :) perhaps i should have during this last upgrade haha
Summary
This PR creates a Heft plugin to support Webpack 5.
Details
See #2586
How it was tested
Created a Webpack 5 test project that builds correctly and runs correctly with
heft start
.