Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit 3c1113b

Browse files
Nandiinznck
Nandiin
authored andcommitted
fix: Copy SFCDescriptor before further passing it to processors (#243)
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.
1 parent 5d8aa49 commit 3c1113b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,14 @@ export default function VuePlugin(opts: VuePluginOptions = {}): Plugin {
194194

195195
async transform(source: string, filename: string) {
196196
if (isVue(filename)) {
197-
const descriptor = parse({
197+
const descriptor: SFCDescriptor = JSON.parse(JSON.stringify(parse({
198198
filename,
199199
source,
200200
compiler: opts.compiler || templateCompiler,
201201
compilerParseOptions: opts.compilerParseOptions,
202202
sourceRoot: opts.sourceRoot,
203203
needMap: true
204-
})
204+
})))
205205

206206
const scopeId =
207207
'data-v-' +

0 commit comments

Comments
 (0)