Closed nCastle1 closed 2 months ago
Thanks for submitting this. Would you mind sharing more info about your use case? I'd like to know more about the build structure in particular. This might be something that needs to be handled on the consuming-project level (e.g., https://www.npmjs.com/package/source-map-loader, https://www.npmjs.com/package/rollup-plugin-sourcemaps).
Connected w/ @nCastle1 on this and we'll revisit this later in the year, if possible. This is a nice-to-have and not blocking workflows at the moment thanks to Nathan's workaround. cc @geospatialem
Closing this, recent changes to Calcite build (I think probably the stencil update?) have rendered this moot. Sourcemaps are working correctly for my workflow in VS Code.
Summary
As a consumer of Calcite Components used through another project, it is sometimes helpful to set breakpoints in Calcite Components source. Examples of when this is helpful include debugging complex browser-specific issues and improving the quality of Calcite Components bug reports.
Currently, Calcite Components emits built output in the
dist/components
folder. The source maps in this folder have paths pointing tosrc/components/
. In effect, this means the source maps point to source files atdist/components/src/components
, whereas the source files are really atsrc/components
. This isn't an issue in the browser, but the incorrect file location breaks debugging integration with tools like VS Code.Desired Outcome
Emit sourcemaps with valid
"sources"
entries by default or add asourceRoot
entry to point to the correct path on disk.Resources
Currently, I can work around this issue by updating the post-build script at
packages/calcite-components/support/patchESMResolution.ts
to also prepend../../
to all paths in sourcemap files. This works for now but it is clearly a hack. Long term, it would be ideal configure Stencil to emit corrected locations by default.