fix packager patch to auto-generate index.*.map files

- looks like in case of error RN tries to load index.ios.map, this file is normally generated by packager. Need to keep it this way.
This commit is contained in:
Artur Girenko 2016-01-21 22:27:36 +01:00
parent f15d9885a4
commit a59efbae6d
2 changed files with 5 additions and 6 deletions

View File

@ -257,9 +257,9 @@ Re-Natal makes almost no changes to the files generated by react-native so the o
### Changes Re-Natal does to original RN application
It would be perfect not to do any changes there, but...
* To make source maps available in "Debug in Chrome" mode re-natal patches
the react native packager to serve \*.map files from file system.
To do this [these lines are commented](https://github.com/facebook/react-native/blob/master/packager/react-packager/src/Server/index.js#L400-L401)
in file "node_modules/react-native/packager/react-packager/src/Server/index.js"
the react native packager to serve \*.map files from file system and generate only index.\*.map file.
To achieve this [this line](https://github.com/facebook/react-native/blob/master/packager/react-packager/src/Server/index.js#L400)
of file "node_modules/react-native/packager/react-packager/src/Server/index.js" is modified to match only index.\*.map
## Tips
- Having `rlwrap` installed is optional but highly recommended since it makes

View File

@ -235,9 +235,8 @@ updateGitIgnore = () ->
patchReactNativePackager = () ->
log "Patching react-native packager to serve *.map files"
edit "node_modules/react-native/packager/react-packager/src/Server/index.js", [
[/^(\s*requestType\s*=\s*'map'\s*;)$/m, "//$1"],
[/^(\s*}\s*else\s*if.*pathname\.match.*\.map.*\{)$/m, "//$1"]]
edit "node_modules/react-native/packager/react-packager/src/Server/index.js",
[[/match.*\.map\$\/\)/m, "match(/index\\..*\\.map$/)"]]
init = (projName) ->
if projName.toLowerCase() is 'react' or !projName.match validNameRx