-
Notifications
You must be signed in to change notification settings - Fork 710
Description
A hires sourcemap is generated here for #3107.
rolldown/crates/rolldown_plugin/src/plugin_driver/build_hooks.rs
Lines 342 to 350 in 299e8c0
| // If sourcemap is empty and code has changed, need to create one remapping original code. | |
| // Here using `hires: true` to get more accurate column information, but it has more overhead. | |
| // TODO: maybe it should be add a option to control hires. | |
| let magic_string = MagicString::new(original_code); | |
| Some(magic_string.source_map(SourceMapOptions { | |
| hires: string_wizard::Hires::True, | |
| include_content: true, | |
| source: id.into(), | |
| })) |
Generating hires sourcemap is costly in terms of memory as it contains many mappings.
But this we can avoid that by improving collapse_sourcemaps.
| pub fn collapse_sourcemaps(mut sourcemap_chain: Vec<&SourceMap>) -> SourceMap { |
Rollup does not use hires sourcemaps and have some additional code to handle these cases in
getCollapsedSourcemap.https://github.com/rollup/rollup/blob/37d1915060e08b84326bee0713444eec7162de88/src/utils/collapseSourcemaps.ts#L190-L203
Reactions are currently unavailable