Commit a6f2bdc
runBuild: Support specifying bundleOut/sourceMapOut
Summary:
Currently Metro's `runBuild` allows saving bundle and source maps to disk via a single `out` argument, which always appends a `.js` extension for bundles (unless `out` already ends with `.js`) and `.map` for source maps.
This means it can't currently be used to implement React Native CLI's `bundle` command, because RN uses `.jsbundle` extension by convention (eg, [here](https://github.com/facebook/react-native/blob/5d7f35cd7c912333987ca82774734dba3bd48716/packages/react-native/scripts/react-native-xcode.sh#L108).
This is an additive API change to allow `bundleOut` and `sourceMapOut` to specify full paths. This also allows us to fix the `react-native/core-cli-utils` todo [here](https://github.com/facebook/react-native/blob/5d7f35cd7c912333987ca82774734dba3bd48716/packages/core-cli-utils/src/private/app.js#L133).
```
- **[Feature]** `runBuild`: Add optional `bundleOut` and `sourceMapOut` arguments to exactly specify output paths.
```
Reviewed By: huntie
Differential Revision: D74397776
fbshipit-source-id: a2cbe5df1a553447d60d6cca5138d318be78dc1f1 parent 416c1ef commit a6f2bdc
3 files changed
Lines changed: 45 additions & 4 deletions
File tree
- docs
- packages/metro/src
- integration_tests/__tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
138 | | - | |
| 139 | + | |
139 | 140 | | |
140 | 141 | | |
| 142 | + | |
141 | 143 | | |
142 | 144 | | |
143 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| 101 | + | |
| 102 | + | |
100 | 103 | | |
101 | 104 | | |
102 | 105 | | |
| |||
394 | 397 | | |
395 | 398 | | |
396 | 399 | | |
| 400 | + | |
| 401 | + | |
397 | 402 | | |
398 | 403 | | |
399 | 404 | | |
| |||
437 | 442 | | |
438 | 443 | | |
439 | 444 | | |
440 | | - | |
441 | | - | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
442 | 449 | | |
443 | | - | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
444 | 453 | | |
445 | 454 | | |
446 | 455 | | |
| |||
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
93 | 123 | | |
94 | 124 | | |
95 | 125 | | |
| |||
0 commit comments