Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sourcemap of import not served/deployed #832

Open
declann opened this issue Feb 16, 2024 · 2 comments
Open

sourcemap of import not served/deployed #832

declann opened this issue Feb 16, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@declann
Copy link
Contributor

declann commented Feb 16, 2024

Hi,

Really liking playing around with Framework, congrats on an awesome release!

We might like sourcemaps to go out of fashion(?) but I generate ESM and keep a sourcemap.

I'm importing that ESM using a regular import:

import * as model from './cul/calcs_esm/cul_scope_0.js'

The file ends with //# sourceMappingURL=cul_scope_0.js.map: a reference to the sourcemap file, but because this file isn't deployed (to dist or to observablehq.cloud) or served (with npm run dev), then it isn't available to devtools - see error:

image

Should/can Framework detect and serve sourcemaps?

On Quarto I include sourcemap files as a resource and they gets served - this could be a workaround, but might need to be a more particular one given Frameworks directory structure (_file, _import etc.)

Thanks!

Declan

@declann declann added the bug Something isn’t working label Feb 16, 2024
@Fil
Copy link
Contributor

Fil commented Feb 16, 2024

Yes we hope to add sourcemaps in the future (see e.g. #805).

@Fil Fil added enhancement New feature or request and removed bug Something isn’t working labels Feb 16, 2024
@mbostock
Copy link
Member

Yes, I think it would be reasonable to check for //# sourceMappingURL=… and include the referenced file in dist on build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants