lumino
lumino copied to clipboard
Add sourcemaps back to original TS
When debugging in JupyterLab (with the UMD bundles introduced in #40), I am seeing the ES6 bundle, we should be able to reach back to the original TS source files:
I've researched this and the related issues extensively. This will require two things:
-
include the ts sources in the released
@luminopackages. Can be done in one of two ways:- add
"inlineSources": trueto thetsconfig.jsonof each package - (my pick) include the
srcdir with the actual.tssources in the release of each package
- add
-
tweak the jlab webpack build to include the sourcemaps produced by
tscfor the@luminopackages-
change this line to something like
include: [...sourceMapRes, '@lumino'],
-
I agree with adding src back to the release.
"src" is already included in the packages (I didn't think it got removed?): https://github.com/jupyterlab/lumino/blob/master/packages/widgets/package.json#L23 https://cdn.jsdelivr.net/npm/@lumino/widgets/
Unless I missed some by mistake?
Also if you look in the map files you should see that the bundled versions map back to the ts files in question: https://cdn.jsdelivr.net/npm/@lumino/[email protected]/dist/index.js.map
I don't see src in node_modules:
$ ls node_modules/@lumino/coreutils/
. .. LICENSE lib package.json
Its there in the released package: https://cdn.jsdelivr.net/npm/@lumino/[email protected]/package.json
...and: https://cdn.jsdelivr.net/npm/@lumino/[email protected]/src/
Looks good yeah, my other folder had 1.4.2.
If your using WebPack to build your project and your including JS files which in turn already have a source map associated with them (like from TS) then you should be using source-map-loader.
Example here: https://github.com/GordonSmith/HPCC-Platform/blob/eclwatch-8.x/esp/src/webpack.config.js#L95-L99
You might need to change the "devTool" for non production builds as well: https://github.com/GordonSmith/HPCC-Platform/blob/eclwatch-8.x/esp/src/webpack.config.js#L111 (not 100% sure)