mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Add "setJsBundlesDirectory" method to CatalystInstanceImpl
Differential Revision: D6042493 fbshipit-source-id: 950c6d6bdc2e0b62b14c9bcfc86233159a002c67
This commit is contained in:
committed by
Facebook Github Bot
parent
21917ab7bf
commit
b5651d945c
@@ -25,20 +25,5 @@ JSModulesUnbundle *RAMBundleRegistry::getBundle(uint32_t bundleId) const {
|
||||
return m_bundles.at(bundleId).get();
|
||||
}
|
||||
|
||||
std::string RAMBundleRegistry::jsBundlesDir(std::string entryFile) {
|
||||
char *pEntryFile = const_cast<char *>(entryFile.c_str());
|
||||
std::string dir = dirname(pEntryFile);
|
||||
std::string entryName = basename(pEntryFile);
|
||||
|
||||
std::size_t dotPosition = entryName.find(".");
|
||||
if (dotPosition != std::string::npos) {
|
||||
entryName.erase(dotPosition, std::string::npos);
|
||||
}
|
||||
|
||||
std::string path = "js-bundles/" + entryName + "/";
|
||||
// android's asset manager does not work with paths that start with a dot
|
||||
return dir == "." ? path : dir + "/" + path;
|
||||
}
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
|
||||
Reference in New Issue
Block a user