Skip to content

Commit 8f63fd5

Browse files
committed
clarify config-overrides.js in README
1 parent 55b22f8 commit 8f63fd5

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@
33
Add [Typescript](https://github.com/microsoft/typescript) Webpack loading to a [`react-app-rewired`](https://github.com/timarney/react-app-rewired) config.
44

55
```js
6-
const rewireTypescript = require('react-app-rewire-typescript')
6+
/* config-overrides.js */
77

8-
// Add Typescript support
9-
config = rewireTypescript(config, env)
8+
const rewireTypescript = require('react-app-rewire-typescript');
9+
10+
module.exports = function override(config, env) {
11+
// ...
12+
config = rewireTypescript(config, env);
13+
// ...
14+
return config;
15+
}
1016
```
1117

1218
For running `.ts` test files, take a look at [`ts-jest`](https://github.com/kulshekhar/ts-jest). PRs to integrate `ts-jest` compatibility into this repo are welcome.

0 commit comments

Comments
 (0)