Skip to content

feat: support source maps without original source code#5732

Open
AliceLanniste wants to merge 4 commits intorolldown:mainfrom
AliceLanniste:sourcemapExcludeContent
Open

feat: support source maps without original source code#5732
AliceLanniste wants to merge 4 commits intorolldown:mainfrom
AliceLanniste:sourcemapExcludeContent

Conversation

@AliceLanniste
Copy link
Copy Markdown
Contributor

close #5554

@I-Enderlord-I
Copy link
Copy Markdown

You didn't add the options to the TS typings in binding.d.ts. They should get generated after a build as demonstrated by the test.

@I-Enderlord-I
Copy link
Copy Markdown

I wonder why there is no getter in BindingNormalizedOptions . There should be, right?

@I-Enderlord-I
Copy link
Copy Markdown

And you also still need to add it in the actually exported TS definitions in options/output-options.ts and options/normalized-output-options.ts.

@AliceLanniste
Copy link
Copy Markdown
Contributor Author

@I-Enderlord-I ,hi I don't understand why must add getter in BindingNormalizedOptions and options in options/output-options.ts,can you explain ?

@I-Enderlord-I
Copy link
Copy Markdown

I-Enderlord-I commented Aug 16, 2025

I don't fully understand the project structure myself (thus why I didn't make a pull request), but as far as I see, the typescript files in packages/rolldown define the JS API. Here the binding.d.ts corresponds to the actual objects transfered from the Rust side, while the other files define all kinds of wrappers around that interface.

Specifically, the options/normalized-output-options.ts is basically a one-to-one wrapper of BindingNormalizedOptions in the binding.d.ts and options/output-options.ts defines the OutputOptions interface as it is passed to the user.

As for adding the getter to BindingNormalizedOptions, I have no idea why it was not automatically generated. To me it seems like it should.

@I-Enderlord-I
Copy link
Copy Markdown

I-Enderlord-I commented Aug 16, 2025

I think I get it now... Check out #2987 to see where passing additional properties to the JS/TS API requires changes.

That still leaves receiving more in options/output-options.ts of course...
I guess crates/rolldown_binding/src/options/binding_output_options/mod.rs is the place to add that.

@I-Enderlord-I
Copy link
Copy Markdown

Ok I was correct. See cf09f46 for everything a new options requires.

@AliceLanniste
Copy link
Copy Markdown
Contributor Author

@I-Enderlord-I THANK YOU SO MUCH

@I-Enderlord-I
Copy link
Copy Markdown

Maybe adding a test to packages/rolldown/tests for this would be nice as well. Just to be sure you got everything and it's actually useable.

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

Successfully merging this pull request may close these issues.

[Feature Request]: Generate source maps without original source code

2 participants