Skip to content

Commit 4534fd0

Browse files
authored
Update Flow instructions (facebook#567)
1 parent 4185a9d commit 4534fd0

File tree

1 file changed

+2
-33
lines changed

1 file changed

+2
-33
lines changed

template/README.md

+2-33
Original file line numberDiff line numberDiff line change
@@ -376,48 +376,17 @@ node_modules/fbjs/lib/Deferred.js.flow:60
376376
node_modules/fbjs/lib/shallowEqual.js.flow:29
377377
29: return x !== 0 || 1 / (x: $FlowIssue) === 1 / (y: $FlowIssue);
378378
^^^^^^^^^^ identifier `$FlowIssue`. Could not resolve name
379-
380-
src/App.js:3
381-
3: import logo from './logo.svg';
382-
^^^^^^^^^^^^ ./logo.svg. Required module not found
383-
384-
src/App.js:4
385-
4: import './App.css';
386-
^^^^^^^^^^^ ./App.css. Required module not found
387-
388-
src/index.js:5
389-
5: import './index.css';
390-
^^^^^^^^^^^^^ ./index.css. Required module not found
391379
```
392380
393381
To fix this, change your `.flowconfig` to look like this:
394382
395383
```ini
396-
[libs]
397-
./node_modules/fbjs/flow/lib
398-
399-
[options]
400-
esproposal.class_static_fields=enable
401-
esproposal.class_instance_fields=enable
402-
403-
module.name_mapper='^\(.*\)\.css$' -> 'react-scripts/config/flow/css'
404-
module.name_mapper='^\(.*\)\.\(jpg\|png\|gif\|eot\|otf\|webp\|svg\|ttf\|woff\|woff2\|mp4\|webm\)$' -> 'react-scripts/config/flow/file'
405-
406-
suppress_type=$FlowIssue
407-
suppress_type=$FlowFixMe
384+
[ignore]
385+
<PROJECT_ROOT>/node_modules/fbjs/.*
408386
```
409387
410388
Re-run flow, and you shouldn’t get any extra issues.
411389
412-
If you later `eject`, you’ll need to replace `react-scripts` references with the `<PROJECT_ROOT>` placeholder, for example:
413-
414-
```ini
415-
module.name_mapper='^\(.*\)\.css$' -> '<PROJECT_ROOT>/config/flow/css'
416-
module.name_mapper='^\(.*\)\.\(jpg\|png\|gif\|eot\|otf\|webp\|svg\|ttf\|woff\|woff2\|mp4\|webm\)$' -> '<PROJECT_ROOT>/config/flow/file'
417-
```
418-
419-
We will consider integrating more tightly with Flow in the future so that you don’t have to do this.
420-
421390
## Adding Custom Environment Variables
422391
423392
>Note: this feature is available with `react-scripts@0.2.3` and higher.

0 commit comments

Comments
 (0)