Skip to content

Commit

Permalink
fix: handle no template code in .vue file (#11)
Browse files Browse the repository at this point in the history
close #15
  • Loading branch information
zouhangwithsweet committed Jun 28, 2022
1 parent 5604341 commit 42b0851
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main.ts
Expand Up @@ -173,7 +173,12 @@ async function genTemplateCode(
pluginContext: PluginContext,
ssr: boolean
) {
const template = descriptor.template!
const template = descriptor.template

if (!template) {
return 'const _sfc_render = null; const _sfc_staticRenderFns = null'
}

const hasScoped = descriptor.styles.some((style) => style.scoped)

// If the template is not using pre-processor AND is not using external src,
Expand Down

0 comments on commit 42b0851

Please sign in to comment.