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

[Feature request] source map generation #1764

Closed
vstefanovic97 opened this issue Jan 19, 2024 · 3 comments
Closed

[Feature request] source map generation #1764

vstefanovic97 opened this issue Jan 19, 2024 · 3 comments

Comments

@vstefanovic97
Copy link
Contributor

I would like to request for the rollup-gjs-plugin to return map (sourceMaps) as we as the code field.

Example where this can be useful, when we are building a v2 addon with the standard v2 blueprint with rollup and let's say we want to use babel-plugin-istanbul to instrument our code, we would need the original source maps so that istanbul would know exactly how to map it's coverage to the original .gjs/.gts source files.

This is also related to embroider-build/content-tag#61 which is needed in order for this to be implemented here

@NullVoxPopuli
Copy link
Collaborator

If we use magic-string in content-tag to generate a sourcemap, we could change the rollup plugin to something like this:

let { code, sourceMap } = processor.process(input, { id, sourceMap: true });

return {
  code,
  map: sourceMap,
};

this could be a non-breaking change to content-tag (different return type based on type of the second arg to process)

@ef4
Copy link
Contributor

ef4 commented Jan 19, 2024

The rust side of content-tag already supports source maps. The JS bindings just don't use it yet.

@vstefanovic97
Copy link
Contributor Author

Closing issue as completed in #1786

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

No branches or pull requests

3 participants