Skip to content

Commit

Permalink
feat: customBlock support for vue2.7+vue-router3 (#326)
Browse files Browse the repository at this point in the history
Co-authored-by: bob <zq188140725@gmail.com>
  • Loading branch information
Bob0911 and bob committed Dec 25, 2022
1 parent b5d34de commit 36c2195
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/customBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export async function parseSFC(code: string): Promise<SFCDescriptor> {
return parse(code, {
pad: 'space',
}).descriptor
// for @vue/compiler-sfc ^2.7
|| (parse as any)({
source: code,
})
} catch {
throw new Error('[vite-plugin-pages] Vue3\'s "@vue/compiler-sfc" is required.')
}
Expand Down

0 comments on commit 36c2195

Please sign in to comment.