From 1073120a16ca47d2c96b7ea60e2b312d25a02a5d Mon Sep 17 00:00:00 2001 From: Milan Hauth Date: Wed, 23 Sep 2020 13:53:58 +0200 Subject: [PATCH] remove unnecessary sourcemap encode --- src/compiler/preprocess/index.ts | 4 ++-- src/compiler/utils/string_with_sourcemap.ts | 11 ----------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/compiler/preprocess/index.ts b/src/compiler/preprocess/index.ts index b521f5fd35..87dada9fba 100644 --- a/src/compiler/preprocess/index.ts +++ b/src/compiler/preprocess/index.ts @@ -177,7 +177,7 @@ export default async function preprocess( } ); source = res.string; - sourcemap_list.unshift(res.get_sourcemap()); + sourcemap_list.unshift(res.map); } for (const fn of style) { @@ -210,7 +210,7 @@ export default async function preprocess( } ); source = res.string; - sourcemap_list.unshift(res.get_sourcemap()); + sourcemap_list.unshift(res.map); } // https://github.com/ampproject/remapping#usage diff --git a/src/compiler/utils/string_with_sourcemap.ts b/src/compiler/utils/string_with_sourcemap.ts index 4dbcc42426..cd7c2ea0a9 100644 --- a/src/compiler/utils/string_with_sourcemap.ts +++ b/src/compiler/utils/string_with_sourcemap.ts @@ -1,5 +1,3 @@ -import { encode as sourcemap_encode } from "sourcemap-codec"; - type MappingSegment = | [number] | [number, number, number, number] @@ -65,15 +63,6 @@ export class StringWithSourcemap { 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 { // noop: if one is empty, return the other if (this.string == '') return other;