Skip to content

Commit

Permalink
fix(plugin-vue): add newline character before class components, fix #…
Browse files Browse the repository at this point in the history
  • Loading branch information
ygj6 authored Apr 10, 2021
1 parent 89898d3 commit 8fe828e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/plugin-vue/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ async function genScriptCode(
const classMatch = script.content.match(exportDefaultClassRE)
if (classMatch) {
scriptCode =
script.content.replace(exportDefaultClassRE, `class $1`) +
script.content.replace(exportDefaultClassRE, `\nclass $1`) +
`\nconst _sfc_main = ${classMatch[1]}`
if (/export\s+default/.test(scriptCode)) {
// fallback if there are still export default
Expand Down

0 comments on commit 8fe828e

Please sign in to comment.