-
Notifications
You must be signed in to change notification settings - Fork 33
feat: add support for generating sourcemaps #276
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
base: main
Are you sure you want to change the base?
Conversation
| "dist/components/script-multi-block.vue.mjs.map", | ||
| "dist/components/script-setup-ts.vue", | ||
| "dist/components/script-setup-ts.vue.mjs.map", | ||
| "dist/components/ts.vue", | ||
| "dist/components/ts.vue.mjs.map", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure about the generation of the *.vue.mjs.map files, as I haven't worked with .vue files before.
| const { writtenFiles } = await mkdist({ | ||
| rootDir, | ||
| esbuild: { | ||
| sourcemap: "linked", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only added a test case with the "linked" option since that's what I'm personally interested in, and I wasn't sure how the option would change if esbuild were to be swapped out with rolldown in the future. I'd be happy to add test cases for the other modes if deemed necessary.
f9d2746 to
40bded1
Compare
4f295d5 to
d8f7dc5
Compare
d8f7dc5 to
195970b
Compare
195970b to
9f925ec
Compare
976f475 to
93f1f41
Compare
The CLI now accepts a `--sourcemap` option that should match the behaviour of `esbuild`'s `--sourcemap` option. The programmatic API's `esbuild.sourcemap` option should now also match with `esbuild`'s `sourcemap` option for the Build API. The `sourcemap: 'linked'` option is special cased in the implementation, since `esbuild` doesn't support the option under the Transform API that `mkdist` uses [^1]. Refs: https://esbuild.github.io/api/#sourcemap Refs: https://sourcemaps.info/spec.html [^1]: https://github.com/evanw/esbuild/blob/745abd9f0c06f73ca40fbe198546a9bc36c23b81/pkg/api/api_impl.go#L1749
93f1f41 to
55518c0
Compare
Resolves #164
The CLI now accepts a
--sourcemapoption that should match the behaviour ofesbuild's--sourcemapoption. The programmatic API'sesbuild.sourcemapoption should now also match withesbuild'ssourcemapoption for the Build API.The
sourcemap: 'linked'option is special cased in the implementation, sinceesbuilddoesn't support the option under the Transform API thatmkdistuses 1.Refs: https://esbuild.github.io/api/#sourcemap
Refs: https://sourcemaps.info/spec.html
Footnotes
https://github.com/evanw/esbuild/blob/745abd9f0c06f73ca40fbe198546a9bc36c23b81/pkg/api/api_impl.go#L1749 ↩