Fix patching of map files

This commit is contained in:
Vitaliy Vlasov 2018-06-04 12:50:36 +03:00
parent 9edffebee0
commit c1a59e5a9f
1 changed files with 2 additions and 13 deletions

View File

@ -381,23 +381,12 @@ updateGitIgnore = (platforms) ->
fs.appendFileSync(".gitignore", "\n# Figwheel\n#\nfigwheel_server.log")
findPackagerFileToPatch = () ->
files = [
"node_modules/metro-bundler/src/Server/index.js",
"node_modules/metro-bundler/build/Server/index.js",
"node_modules/react-native/packager/src/Server/index.js"]
fileToPatch = files[0];
for f in files
if fs.existsSync(f)
fileToPatch = f
fileToPatch
patchReactNativePackager = () ->
installDeps()
fileToPatch = findPackagerFileToPatch()
fileToPatch = "node_modules/metro/src/Server/index.js"
log "Patching file #{fileToPatch} to serve *.map files."
edit fileToPatch,
[[/match.*\.map\$\/\)/m, "match(/index\\..*\\.map$/)"]]
[[/match\(\/\\.map\$\/\)/m, "match(/index\\..*\\.map$/)"]]
log "If the React Native packager is running, please restart it."
shimCljsNamespace = (ns) ->