pull/5854/head
Milan Hauth 6 years ago
parent 0b2b77cb19
commit 9d17d78729

@ -291,8 +291,7 @@ export function apply_preprocessor_sourcemap(filename: string, svelte_map: Sourc
return result_map as SourceMap;
}
// find attached sourcemap in processed.code
// TODO? handle multiple attached maps, combine with processed.map
// parse attached sourcemap in processed.code
export function parse_attached_sourcemap(processed: Processed): void {
const magic_prefix = '\n/*# sourceMappingURL=data:application/json;';
const cut_index = processed.code.lastIndexOf('\n');

@ -7,7 +7,8 @@ export function test({ input, css, js }) {
let out_obj, loc_output, actual, loc_input, expected;
out_obj = js;
// we need the seconds occurence in output.js
// we need the second occurence of 'done_replace_script_2' in output.js
// the first occurence is mapped back to markup '{done_replace_script_2}'
loc_output = out_obj.locate_1('done_replace_script_2');
loc_output = out_obj.locate_1('done_replace_script_2', loc_output.character + 1);
actual = out_obj.mapConsumer.originalPositionFor(loc_output);
@ -22,7 +23,6 @@ export function test({ input, css, js }) {
out_obj = css;
loc_output = out_obj.locate_1('.done_replace_style_2');
actual = out_obj.mapConsumer.originalPositionFor(loc_output);
// first occurence in input.svelte
loc_input = input.locate_1('.replace_me_style');
expected = {
source: 'input.svelte',

Loading…
Cancel
Save