-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Extend the module extension list in package.json #8123
Comments
We're planning a config rework coming up soon. I personally think the exact thing you're proposing might not become part of it and there's always a limit do what you can do declaratively in a reasonably simple way, but it looks like we should definitely have better warnings in place, so thanks for bringing this up! |
You can do I do think adding some docs calling out that replacing the extensions potentially can break integrations. Wanna send a PR to the docs? Beyond that, as @jeysal mentions, we wanna rework our config (#7185). If anything, I think it makes sense to move towards more config in js and less in json since it's so inflexible. Adding a new option that just extends without replacing doesn't sound like something we want to do... |
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 14 days. |
This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🚀 Feature Proposal
Unless I am overlooking something, it's currently only possible to override the module extension list in
package.json
, not extend it. The documentation actually gives an example how to extend it injest.config.js
.Motivation
This came up in enzymejs/enzyme#2046. Replacing the default list is problematic, since it can break third-party package and the fix is not easily obvious. In this particular case, enzyme-react-adapter-16's update from version 1.10.0 to 1.11.0 added an import of a
package.json
file, without the file extension. This is reasonable, since.json
is on node's default suffix list, but broke jest for many people.While it is possible to extend the list in
jest.config.js
, using a declarative configuration inpackage.json
is probably what most people prefer to do.This potential problem should also be warned about in the description of the
moduleFileExtensions
option.The text was updated successfully, but these errors were encountered: