-
Notifications
You must be signed in to change notification settings - Fork 119
Map local folder to URL #146
Map local folder to URL #146
Comments
This is what the 'webRoot' property is for, it's the local path of the URL hostname. Note that you can check how paths have been resolved with the |
so is it possible to map local files to URL like this? And it works only if you use sourceMapping. It doesn't work with simple js. |
Actually right, since the paths are different in |
Is it possible to dev and open a pull request? Where's the code related to source path mapping? |
Definitely, the relevant code for mapping paths without sourcemaps or before sourcemaps are applied would be around here - https://github.com/Microsoft/vscode-chrome-debug-core/blob/master/src/transformers/urlPathTransformer.ts#L63 That function is called when a new script is loaded, and returns the local path of the script (if it exists locally) |
@roblourens not sure if I need to open an issue for this but when I want to build (gulp build or gulp watch). I have this (strange) error:
I've done the same with vscode-chrome-debug extension (npm run build) and it seems to work fine. ps: |
Your node version probably isn't recent enough, since it doesn't like that library's ES2015 syntax. Can you use 6.x for running npm install? You should be able to switch back after that if needed. |
Hi @llgcode Thanks for opening the issue and for the PR! I'm having a hard time understanding the specific use case that requires this new path mapping capability? Are you trying to debug two different websites/apps that lives inside he same code-base? It should be the responsibility of your build tool to generate sourcemaps that has the correct paths for any given resource. Our |
Hi @auchenberg,
with this you don't need to override source map with sourceMapPathOverrides. Source map is for url (see sources and sourceRoot) that is used by your browser, path mapping is here just to map local path to url and vscode uses local path not url so we need a mapping between both world. |
Right, this is relevant when there are no sourcemaps, or sourcemaps are only available locally. |
If I check sourceMap spec, it specify where we found URL source
...
sources – An array of URLs for the original source files.
sourceRoot – (optional) The URL which all of the files in the sources array will be resolved from.
...
I haven't found a way to map sources url to source local path like this (like in chrome when we simply map a local folder to network resource...)
sourceMapPathOverrides don't allow this kind of config and this is not a shared config over launchers.
The text was updated successfully, but these errors were encountered: