Closed okoala closed 6 years ago
eggjs/egg#839
@okoala Thank you for reporting. I'll working on this.
Let me explain the background of this issue.
I have been tackling with sourcemap issues for a couple of years, and for filepaths, had faced 2 problems.
sourceRoot
option is originally intended to used by browsers, pointing paths from content root.These are why I don't use sourceMapRoot
option.
Then I've found that sourcesContent
property for the rescue. If original code is embedded in sourcesContent
property, debuggers use content of sourcesContent
instead of reading original files from URL/filesystem. It'd solved annoying path problems and security issues. Keeps everything self-contained.
Chrome, Firefox, Safari and WebStorm/IntelliJ uses sourcesContent
for debugging.
How about VSCode? Unfortunately, VSCode ignores sourcesContent
"by design" (OMG).
I'm going to accept and fix this issue for now since Chrome/Firefox/Safari and WebStorm will continue to use sourcesContent
for debugging. However, if there are some issues caused by sourceRoot
, I'll revert the fix here and try to fix this again at espower-loader
level.
@okoala espower-source 2.2.0 is out. Would you give it a try?
@twada thinks a lot, i try it now.
Closing for now. Please feel free to reopen this issue when reproduced.
https://github.com/power-assert-js/espower-source/blob/master/index.js#L193
My question is when i debug test file, vscode cannot find the correct file path.
vscode log:
but i when i set
escodegenOptions.sourceMapRoot
and it works.