Last active
September 26, 2022 16:52
-
-
Save callstack-bot/22ac442379284e7acd1473965c38f579 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const resolveURL = Federated.createURLResolver({ | |
containers: { | |
app1: 'http://localhost:9000/[name][ext]', | |
app2: 'http://localhost:9001/[name][ext]', | |
module1: 'http://localhost:9002/[name][ext]', | |
}, | |
}); | |
ScriptManager.shared.addResolver(async (scriptId, caller) => { | |
let url; | |
if (caller === 'main') { | |
url = Script.getDevServerURL(scriptId); | |
} else { | |
url = resolveURL(scriptId, caller); | |
} | |
if (!url) { | |
return undefined; | |
} | |
return { | |
url, | |
cache: false, | |
query: { | |
platform: Platform.OS, | |
}, | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment