-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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: adds transparent PnP support to Webpack #4953
Conversation
yarn.lock
Outdated
@@ -7045,7 +7045,7 @@ errorhandler@^1.5.1: | |||
accepts "~1.3.7" | |||
escape-html "~1.0.3" | |||
|
|||
es-abstract@^1.12.0, es-abstract@^1.4.3, es-abstract@^1.5.1, es-abstract@^1.7.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.
Those changes aren't needed by my diff, they just got there when running yarn add
🤔
@@ -37,6 +37,10 @@ module.exports = (api, options) => { | |||
.publicPath(options.publicPath) | |||
|
|||
webpackConfig.resolve | |||
// This plugin can be removed once we switch to Webpack 6 | |||
.plugin('pnp') | |||
.use({ ...require('pnp-webpack-plugin') }) |
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.
The spread is a small trick required for webpack-chain
(it mutates the plugin instance, but since the PnP plugin is supposed to be the same instance for every config it crashes when webpack-chain tries to override its previous registration).
Looks good to me. But I would wait for @sodatea to merge it. |
@arcanis Can you rebase this? I would like vue-cli to support the pnp feature. It's really good feature 😄 |
@pksunkara done! Let me know when it gets released and I'll setup our E2E tests accordingly to confirm everything is good 🙂 |
I tested this locally. |
* feat: adds transparent PnP support to Webpack * fix: add the plugin name * fix: now pass tests
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
Other information:
Followup to #2850 - I've fixed the remaining issues on our side, only remains one thing! 🎉
Webpack currently requires using the PnP Webpack plugin in order to properly resolve dependencies (it will be optional starting from Webpack 6). It doesn't have any effect for people that aren't using PnP, so no risks at all 🙂