Skip to content
This repository has been archived by the owner on Jan 26, 2019. It is now read-only.

Allow moduleNameMapper config override #303

Merged
merged 4 commits into from
May 9, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/react-scripts/scripts/utils/createJestConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ module.exports = (resolve, rootDir, isEjecting) => {
'coverageReporters',
'coverageThreshold',
'snapshotSerializers',
'moduleNameMapper',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • This should be listed in the corresponding README to be adjustable. Just recognized that the original section on CRA (https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#configuration) is absent here... However, this field (and potentially the section) should be listed there, including the example usage and a note on how this relates to entries in the tsconfig.json.
  • I'm still thinking about the default value used on this field, '^react-native$': 'react-native-web'. It should either be noted that it has to be provided manually in case of overriding this key, or that entry should be merged automatically. Suppose the first way might be preferable.

];
if (overrides) {
supportedKeys.forEach(key => {
Expand Down
1 change: 1 addition & 0 deletions packages/react-scripts/template/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"outDir": "build/dist",
"module": "esnext",
"target": "es5",
Expand Down