fix(compiler-sfc): rewriteDefault support multiline (#3917)

This commit is contained in:
ygj6
2021-06-10 03:07:48 +08:00
committed by GitHub
parent db1dc1c630
commit b228abb72f
2 changed files with 31 additions and 1 deletions

View File

@@ -2,7 +2,7 @@ import { parse, ParserPlugin } from '@babel/parser'
import MagicString from 'magic-string'
const defaultExportRE = /((?:^|\n|;)\s*)export(\s*)default/
const namedDefaultExportRE = /((?:^|\n|;)\s*)export(.+)as(\s*)default/
const namedDefaultExportRE = /((?:^|\n|;)\s*)export(.+)as(\s*)default/s
const exportDefaultClassRE = /((?:^|\n|;)\s*)export\s+default\s+class\s+([\w$]+)/
/**