-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change build.js.dev.ts to generate "sourceRoot" property instead of leaving it empty (enable debugging inside IDEA/Webstorm)) #1220
Comments
@geekrumper thanks for reporting this issue. I'll see if I can take care of it today. |
Having external sourcemaps is quite painful for istanbul and karma...You can enable/disable it for your project; take a look here. |
Adding back in the commented out code did not generate the correct sourceRoot in the source map file. The number of "../" in the sourceRoot was doubled + plus one. I believe the plus one is because relative wants to work with directories rather than files. So instead of using file.path, using file.dirname could address that shortcoming. More importantly the plugin that builds the sourcemap already is putting in the "../" for each directory deep from the root, which is why the "../" are being double in the actual sourceRoot setting in the map file. If the about objects were nested under another directory, such as screens/about the number of extra "../" double for each layer deeper. I have modify the logic and now get the correct sourceRoot.
Through trial and error we realized that we needed ../../ to be added to the source map root and then let the plugin generate the "../" for how nested the js/ts file is. I believe this is because the resulting files are stored into /dist/dev. If someone has more knowledge here and a better explanation of why we needed the ../../ prefix I would be very interested to learn. @mgechev can you try out this setting for building sourcemaps and see if it is still painful for istanbul and karma. Thanks, Tom |
@TomJahncke That worked for me also. |
IMPORTANT: This repository's issues are reserved for feature requests and bug reports. Do not submit support requests here.
Steps to reproduce and a minimal demo of the problem
What steps should we try in your demo to see the problem?
Current behavior
Since "sourceRoot" property is empty (from source maps files), IDEA/Webstorm cannot trigger breakpoints set in typescript files.
Expected/desired behavior
task: "build.dev" should fill in the "sourceRoot" property accordingly
Other information
Also check this issue from jetbrains having a proposal for the transpilation process:
https://youtrack.jetbrains.com/issue/WEB-22451
I have tried this proporsal myself but typescript is complaing that "path" cannot be resolved. Since I'm very new to gulp, I uncertain if this mean "APP_DEST" should be of Path or something similar.
If there is an easier way to debug angular-seed inside IDEA/Webstorm, I would like to know. I've tried following configurations without success:
And yes I know that chrome can handle this, but for me it's not a clean process, to change the environment (chrome dev tools) for debugging.
I've also created an issue at jetbrains for more clarification: https://youtrack.jetbrains.com/issue/IDEA-159932
The text was updated successfully, but these errors were encountered: