3 ms·
One of the maintainers of ts-loader here. Debugging original source is totally possible. Take a look at the setup here: https://github.com/TypeStrong/ts-loader/
by johnny_reilly 10y ago
One of the maintainers of ts-loader here. Debugging original source is totally possible. Take a look at the setup here: https://github.com/TypeStrong/ts-loader/tree/master/examples/webpack2-gulp-react-flux-babel-karma https://github.com/TypeStrong/ts-loader/tree/master/examples...
And in the official samples (WebPack 1): https://github.com/Microsoft/TypeScriptSamples/tree/master/react-flux-babel-karma https://github.com/Microsoft/TypeScriptSamples/tree/master/r...
- seniorsassycat 10y agoSo I did reference those examples when I setup this project, but this doesn't have to do with typescript, or ts-loader. Here's some gists showing a minimal reproduction without typescript. https://gist.github.com/anonymous/ad044363f73b845cccb4e7f2259ac398 https://gist.github.com/anonymous/ad044363f73b845cccb4e7f225... Specifically, look at lines 25 and 28 of lib-main.js
- johnny_reilly 10y agoYour WebPack.config.js appears to be missing this: devtool: 'inline-source-map' No sourcemaps, no debugging original source. Hope that helps
- seniorsassycat 10y agolib-main-dev.js is an example of the output when running 'webpack -d', which is short for '--devtool sourcemap --debug --output-pathinfo', it has the same problem* There are really two problems contributing to this. First, webpack rewrites import/export statments and never introduces a variable binding with the same name as the bindings used in the original import/export. Second sourcemaps _do_ map lines of compiled code to lines of original source, but they _do not_ map renamed variables to original names. As an example, enable minifiaction and soucemaps then try to debug a function. You might notice that the variables are all called a, b, c, and other short uglified strings now. * I just realized that the file I uploaded is missing the ends of each line, so that file is incorrect.