fix NODE_PATH imports in create-react-app#3
fix NODE_PATH imports in create-react-app#3bugzpodder wants to merge 1 commit intoarcanis:masterfrom bugzpodder:master
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 😮 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