You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: The resolution for the resulting mappings is the minimum of this map and the supplied map.
better show a warning when older mappings are not reachable
the warning can be disabled with a allowLossyRemap flag, or so
not possible in a reliable way, without tokenizing source files = out of scope
supporting sourcemap-generators who can only produce lowres maps, is ....
probably out-of-scope
modify the backtracing algorithm, to support lowres sourcemaps
lowres sourcemap means:
if one line was not changed, the mapping line is empty
(probably same for segments)
this is simple with the array interface
where every map has exactly one source file
so we can copy missing mappings from parent to child
in a more complex scene (convergent transform chain)
with multiple source files, we need a way to find the 'main source file'
index zero should work in most cases, but not in all cases
snippet to sometimes detect lost source files
// convergent transform chain:// 3 2 1// bundle.js < bundle.js < bundle.js <// src-4 src-3 src-1// src-2// sample:// when transform 2 gives a lowres sourcemap// and 2 does not modify the changes of 1// then src-1 and src-2 are 'lost source files'//// problem:// this method is not reliable.// if at least one segment can trace back// then the sourcefile is not detected as lostconstsourcemap_list=[/* .... */];constfilename='bundle.js';// main source file in every sourcemapletmap_idx=1;constmap=remapping(// use loader interfacesourcemap_list[0],// last mapfunctionloader(sourcefile){if(sourcefile==filename&&sourcemap_list[map_idx]){returnsourcemap_list[map_idx++];// idx 1, 2, ...// bundle file = branch node}elsereturnnull;// source file = leaf node});// show warning if source files were lostconstsources_lost=sourcemap_list.map(m=>m.sources.filter(s=>!map.sources.includes(s)));if(sources_lost.find(a=>a.length>0))console.log('warning. combine_sourcemaps lost source files:\n'+JSON.stringify(sources_lost,null,2)+'\nprobably you want to generate high-resolution sourcemaps.');
The text was updated successfully, but these errors were encountered:
today i learned, after an hour of debugging ....
remapping via backtracing works only with high resolution sourcemaps
this should at least be documented in the readme
since some sourcemap-generators produce lowres maps by default
package source-map says
better show a warning when older mappings are not reachablethe warning can be disabled with a
allowLossyRemap
flag, or sonot possible in a reliable way, without tokenizing source files = out of scope
supporting sourcemap-generators who can only produce lowres maps, is ....
probably out-of-scope
modify the backtracing algorithm, to support lowres sourcemaps
lowres sourcemap means:
if one line was not changed, the mapping line is empty
(probably same for segments)
this is simple with the array interface
where every map has exactly one source file
so we can copy missing mappings from parent to child
in a more complex scene (convergent transform chain)
with multiple source files, we need a way to find the 'main source file'
index zero should work in most cases, but not in all cases
snippet to sometimes detect lost source files
The text was updated successfully, but these errors were encountered: