-
Notifications
You must be signed in to change notification settings - Fork 19
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
fix NODE_PATH imports in create-react-app #3
Conversation
Thanks! Do you really need {
resolve: {
modules: [
`node_modules`,
`${__dirname}/src`
]
}
} I'm a bit annoyed with adding |
I think this is what CRA does already see https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/config/webpack.config.prod.js |
I bootstrapped a simplier webpack repo: https://github.com/rwieruch/minimal-react-webpack-babel-setup and it confirms that this plugin blocks resolve.modules from resolving properly.
|
That's strange - I've just added a test and it seems to work 😮 https://github.com/arcanis/pnp-webpack-plugin/blob/master/index.test.js#L56-L61 Will try to get a repro with your repository |
Ok! I understood why it worked - an interaction between Jest and an edge case in PnP was causing that. I've setup yarnpkg/yarn#6643 to fix that. Regarding the |
I like your suggestion. Perhaps we can check if !(modules.length === 1 && modules[0] == '/node_modules/'). |
Yep, something like that would be good! 👍 |
Unfortunately i spent a few minutes digging into it and I couldn't figure out how (disclaimer: I am a webpack plugin n00b). Feel free to close this PR and make your own that does all these! |
Fixes facebook/create-react-app#5643