You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Source maps when compiled through ts-babel-node aren't correct. It's an issue with babel (see babel/babel#5408), however as a workaround, there's a good module on merging source maps, merge-source-map.
I've been stepping through the module with a debugger and saving the maps, and using https://sokra.github.io/source-map-visualization to visualise them. Using the package mentioned above gives much better results.
Is this something you'd accept a pull request on?
Essentially you just don't pass the inputSourceMap to babelOpts:
functioncompile(base,code,filename){varsourcemap=convertSourceMap.fromSource(code).toObject();code=convertSourceMap.removeMapFileComments(code);varbabelOutput=babel.transform(code,getBabelOpts(filename,/* sourcemap */null));// babelOutput has a bunch of undocumented stuff on it. Just grab what we need to save memoryvarmergedMap=mergeSourceMap(sourcemap,babelOutput.map);outputs[filename]={code: babelOutput.code,map: mergedMap};returnbase.call(this,babelOutput.code,filename);}
and set the baseBabelOpts as so:
varbaseBabelOpts={ast: false,sourceMaps: true};
The text was updated successfully, but these errors were encountered:
Source maps when compiled through ts-babel-node aren't correct. It's an issue with babel (see babel/babel#5408), however as a workaround, there's a good module on merging source maps, merge-source-map.
I've been stepping through the module with a debugger and saving the maps, and using https://sokra.github.io/source-map-visualization to visualise them. Using the package mentioned above gives much better results.
Is this something you'd accept a pull request on?
Essentially you just don't pass the inputSourceMap to babelOpts:
and set the baseBabelOpts as so:
The text was updated successfully, but these errors were encountered: