ember-cli-babel
ember-cli-babel copied to clipboard
Respect babel retainLines option.
Hi,
While trying to set ember developing environment with vscode and vscode-debug-chrome extenstion I was facing some issues with setting breakpoints since they where offset in the source code.
I found that this setting allow for correct line mapping and by this solving this issue. I think that others might find this useful for their development as well.
Any reason to not enable this all the time? "semi wacky code" may not be bad, as long as it isn't TOO BAD.
Areas of concern would be:
- build speed
- ??
cc @rwjblue
What does the option actually do? Can you share some before / after code snippets (and likely sourcemaps)?
Hey, Please see the following:
When using original current version of babel setting a breakpoint will not stop on the correct line


After installing the modified version that support retainLines



Settings in launch.js file to support this

@stefanpenner I do not notice any major build speed change
@rwjblue This addition to support retainLines is optional and can be controlled by the developer from ember-cli-build.js
If you will accept this PR I'm sure it can assist many developers and should be documented in the readme.
Thanks
Wondering if there's any movement on this, running into line offset problems often while developing.
edit: Hmm after reading the description of the option, it doesn't feel like this will solve my issue. I'm running into sourcemap line offset issues.
Babel will make an effort to generate code such that items are printed on the same line that they were on in the original file. This option exists so that users who cannot use source maps can get vaguely useful error line numbers, but it is only a best-effort, and is not guaranteed in all cases with all plugins.