Skip to content

Commit

Permalink
Fixes for ReactNative 0.57
Browse files Browse the repository at this point in the history
  • Loading branch information
wnr committed Sep 24, 2018
1 parent a976a59 commit c38327a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion re-natal.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ generateDevScripts = () ->

for platform in platforms
moduleMap = generateRequireModulesCode(platformModulesAndImages(config, platform))
fs.writeFileSync "index.#{platform}.js", "#{moduleMap}require('figwheel-bridge').withModules(modules).start('#{projName}','#{platform}','#{devHost[platform]}');"
fs.writeFileSync "index.#{platform}.js", "#{moduleMap}require('./figwheel-bridge').withModules(modules).start('#{projName}','#{platform}','#{devHost[platform]}');"
log "index.#{platform}.js was regenerated"

updateIosRCTWebSocketExecutor(devHost.ios)
Expand Down
8 changes: 5 additions & 3 deletions resources/figwheel-bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,17 @@ function importJs(src, success, error) {
}

function interceptRequire() {
var oldRequire = window.require;
var oldRequire = window.__r;
console.info("Shimming require");
window.require = function (id) {
function newRequire (id) {
console.info("Requiring: " + id);
if (externalModules[id]) {
return externalModules[id];
}
return oldRequire(id);
};
}
window.require = newRequire;
window.__r = newRequire;
}

function serverBaseUrl(host) {
Expand Down

0 comments on commit c38327a

Please sign in to comment.