Open h-a-n-a opened 2 years ago
Do you mean sourcemap::SourceMap
vs String
?
Or from js side?
If you mean js side, string-based approach is marginally faster
Do you mean
sourcemap::SourceMap
vsString
? Or from js side?If you mean js side, string-based approach is marginally faster
From rust side, in some scenario we might choose sourcemap::SourceMap
over String
in order to do something next and we still keep the JS side as is.
You can generate sourcemap::SourceMap
using swc_common
swc
is not a good choice for most of the downstream crates I think.
Almost all modules of swc, including ASTs, are exposed in reusable form.
What's your usecase? @swc/core
+ custom passes? This is the main intended usecase for the crate swc
but I'm not sure why sourcemap::SourceMap
is required for this kind of usage.
You can generate
sourcemap::SourceMap
usingswc_common
swc
is not a good choice for most of the downstream crates I think.Almost all modules of swc, including ASTs, are exposed in reusable form.
What's your usecase?
@swc/core
+ custom passes? This is the main intended usecase for the crateswc
but I'm not sure whysourcemap::SourceMap
is required for this kind of usage.
Thanks for the quick reply, I will see if using swc_common
directly could help. However, from my perspective of view, this would largely expose swc interior code to upper-stream.
Describe the feature
Currently, source map forces to be generated as code, which restricts upper-stream developer to consume sourcemap instance directly. I was wondering if we could provide an option to output
sourcemap
directly, which avoids unnecessary serializations and deserializationsBabel plugin or link to the feature description
No response
Additional context
No response