-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Support Yarn PnP #6049
Comments
For those wondering, this is the error:
|
Running |
Just to add some additional info, I created a new project with only NextJS, the PnpWebpackPlugin, and a single page file. It looks like this: package.json {
"installConfig": {
"pnp": true
},
"scripts": {
"dev": "next"
},
"dependencies": {
"next": "8.1.0",
"react": "16.8.6",
"react-dom": "16.8.6"
},
"devDependencies": {
"pnp-webpack-plugin": "1.4.3"
}
} next.config.js const PnpWebpackPlugin = require('pnp-webpack-plugin')
module.exports = {
webpack(config) {
if (!config.resolve) config.resolve = {}
if (!config.resolveLoader) config.resolveLoader = {}
if (!config.resolve.plugins) config.resolve.plugins = []
if (!config.resolveLoader.plugins) config.resolveLoader.plugins = []
config.resolve.plugins.push(PnpWebpackPlugin)
config.resolveLoader.plugins.push(PnpWebpackPlugin.moduleLoader(module))
// Return the modified config
return config
},
} pages/index.js export default () => (<div>Hello, World!</div>) If I run |
Yarn PnP now works out of the box! |
Is there an example of this? I don't think people get this working because anything non-trivial uses CSS plugin that does not work, see here: |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Feature request
It would be nice to have support for Yarn PnP, now that it's officially stable in Yarn 1.12. Here's some info on enabling it: https://gist.github.com/arcanis/02b49752c385908479734d8027d7a6c7.
Create React App 2.0 supports PnP via pnp-webpack-plugin, so it might be a nice reference for implementation.
The text was updated successfully, but these errors were encountered: