From a972aae4458f63269e4b82bbdcb9850973554bae Mon Sep 17 00:00:00 2001 From: Nandiin Date: Mon, 5 Nov 2018 16:56:33 +0800 Subject: [PATCH] fix: Copies SFCDescriptor before further passing it to processors scss processor modifies descriptor.styles[x].map.mappings and `parse` function from `component-compiler-utils` caches the parsing result. These two combined would cause a bug when rolling-up multiple-output configuration since the descriptor is modified and cached in the first turn and causing successive turns to fail. --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index b67112b..1c5b7c4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -194,14 +194,14 @@ export default function VuePlugin(opts: VuePluginOptions = {}): Plugin { async transform(source: string, filename: string) { if (isVue(filename)) { - const descriptor = parse({ + const descriptor: SFCDescriptor = JSON.parse(JSON.stringify(parse({ filename, source, compiler: opts.compiler || templateCompiler, compilerParseOptions: opts.compilerParseOptions, sourceRoot: opts.sourceRoot, needMap: true - }) + }))) const scopeId = 'data-v-' +