-
Notifications
You must be signed in to change notification settings - Fork 214
Use default webpack module resolution #926
Use default webpack module resolution #926
Conversation
Since the custom module resolution is not required, and has been the cause of at least 3 bugs that I have spent hours debugging. The vast majority of modules referenced by Neutrino already use `require.resolve()` and so are unaffected by this change. Those that do not (for example eslint presets, since eslint doesn't support specifying them as full paths), were not helped by this custom module resolution anyway, since the resolution happens outside of webpack, and so relied on hoisting even before this change. The `node_modules` option has been removed in favour of using the Neutrino API (or else `NODE_PATH`). Customising module resolution is a massive footgun and should not be used in most cases. Fixes #822.
I think the major reason we used these node_modules settings was to test create-project with |
True :-) Though I've tested this with a |
@@ -93,8 +93,6 @@ module.exports = neutrino => { | |||
[extensionsToNames(style)]: require.resolve('./style-mock') | |||
}), | |||
bail: true, | |||
// eslint-disable-next-line camelcase | |||
coveragePathIgnorePatterns: [node_modules], |
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.
We don't need this line any more?
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 default is the regexp pattern "/node_modules/"
which matches all node_modules:
https://facebook.github.io/jest/docs/en/configuration.html#coveragepathignorepatterns-array-string
The previous value was the custom node_modules
setting which no longer exists.
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.
OK perfect.
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.
Love seeing all the red. 👍
Since the custom module resolution is not required, and has been the cause of at least 3 bugs that I have spent hours debugging.
The vast majority of modules referenced by Neutrino already use
require.resolve()
and so are unaffected by this change. Those that do not (for example eslint presets, since eslint doesn't support specifying them as full paths), were not helped by this custom module resolution anyway, since the resolution happens outside of webpack, and so relied on hoisting even before this change.The
node_modules
option has been removed in favour of using the Neutrino API (or elseNODE_PATH
). Customising module resolution is a massive footgun and should not be used in most cases.Fixes #822.