Support external sourceContent link
Closed this issue · 4 comments
Reference to external map source mapping cannot establish a connection, can it be automatically requested to be added to the dependent external code, like this sourcemap:
{
"version": 3,
"file": "main.sourcemap",
"sections": [
{
"offset": {
"line": 0,
"column": 0
},
"map": {
"version": 3,
"sources": [
"/code/node_modules/metro-bundler/src/Resolver/polyfills/prelude.js"
],
"names": [
"global",
"__DEV__",
"__BUNDLE_START_TIME__",
"nativePerformanceNow",
"Date",
"now"
],
"mappings": "EAAA,SAAAA,GAYAA,EAAOC,SAAU,EAEjBD,EAAOE,sBAAwBF,EAAOG,qBACtCH,EAAOG,uBACPC,KAAKC,OAhBL"
}
}
]
}
Unable to restore code without sourceContent
can it be automatically requested to be added to the dependent external code
Sorry, what does this mean? I don't understand.
I am using this tool to restore react-native code, but I found that the sourcemap generated by the older rn cli version is in the above json format, while the sourcemap format generated by the latest cli is as follows:
{
"version": 3,
"sources": [],
"sourcesContent": [
"some code here"
],
"names": [],
"mappings": []
}
It has no sections
and adds sourceContent
to store source code
The two json formats are different, but only the second one below works fine.
This visualization is most useful when sourcesContent
is present, so you should configure your tool to make sure sourcesContent
is present when debugging. That's not something that this visualization can do for you though. That's something that you have to do for yourself. I'm not sure exactly what you're asking for. This is a browser-based app, so it can't access files on the file system such as /code/node_modules/metro-bundler/src/...
in your example.
This visualization is most useful when
sourcesContent
is present, so you should configure your tool to make suresourcesContent
is present when debugging. That's not something that this visualization can do for you though. That's something that you have to do for yourself. I'm not sure exactly what you're asking for. This is a browser-based app, so it can't access files on the file system such as/code/node_modules/metro-bundler/src/...
in your example.
You are right, local files cannot be loaded in browser. I should make sure the bundler does something like sourcemap merging. This issue can be closed.