remove unnecessary sourcemap encode

pull/5428/head
Milan Hauth 5 years ago
parent 2cf1ae6ad3
commit 1073120a16

@ -177,7 +177,7 @@ export default async function preprocess(
} }
); );
source = res.string; source = res.string;
sourcemap_list.unshift(res.get_sourcemap()); sourcemap_list.unshift(res.map);
} }
for (const fn of style) { for (const fn of style) {
@ -210,7 +210,7 @@ export default async function preprocess(
} }
); );
source = res.string; source = res.string;
sourcemap_list.unshift(res.get_sourcemap()); sourcemap_list.unshift(res.map);
} }
// https://github.com/ampproject/remapping#usage // https://github.com/ampproject/remapping#usage

@ -1,5 +1,3 @@
import { encode as sourcemap_encode } from "sourcemap-codec";
type MappingSegment = type MappingSegment =
| [number] | [number]
| [number, number, number, number] | [number, number, number, number]
@ -65,15 +63,6 @@ export class StringWithSourcemap {
this.map = map; this.map = map;
} }
get_sourcemap() {
return {
version: 3,
sources: this.map.sources.slice(),
names: this.map.names.slice(),
mappings: sourcemap_encode(this.map.mappings as any)
};
}
concat(other: StringWithSourcemap): StringWithSourcemap { concat(other: StringWithSourcemap): StringWithSourcemap {
// noop: if one is empty, return the other // noop: if one is empty, return the other
if (this.string == '') return other; if (this.string == '') return other;

Loading…
Cancel
Save