mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-29 01:45:40 +08:00
Add "node" to Jest's moduleFileExtensions (#2738)
Jest's default value for this option is ["js", "json", "jsx", "node"]. CRA's current value is ["web.js", "js", "json", "web.jsx", "jsx"], which is missing one of default ones: "node". This change fixes that. This "node" extension is used in packages that use native code.
This commit is contained in:
committed by
Dan Abramov
parent
804ac00095
commit
16f0d4a56c
@@ -43,7 +43,7 @@ module.exports = (resolve, rootDir, isEjecting) => {
|
||||
moduleNameMapper: {
|
||||
'^react-native$': 'react-native-web',
|
||||
},
|
||||
moduleFileExtensions: ['web.js', 'js', 'json', 'web.jsx', 'jsx'],
|
||||
moduleFileExtensions: ['web.js', 'js', 'json', 'web.jsx', 'jsx', 'node'],
|
||||
};
|
||||
if (rootDir) {
|
||||
config.rootDir = rootDir;
|
||||
|
||||
Reference in New Issue
Block a user