getsentry / rust-sourcemap

A library for rust that implements basic sourcemap handling
Other
224 stars 28 forks source link

Add a Method to Obtain Ownership of Source Map Fields #99

Open SyMind opened 1 week ago

SyMind commented 1 week ago

When using SWC to transform JavaScript, I need to convert the source map returned by SWC into the source map of rspack-sources.

I expect to reuse the data in the source map during the conversion process, so I hope there could be an API like the following:

let sources: Vec<Arc<str>> = sourcemap.take_sources();
let sources_content: Vec<Arc<str>> = sourcemap.take_sources_content();
loewenheim commented 1 week ago

Hi, thank you for the suggestion.