Skip to content

Commit

Permalink
fix: fix template compiler import (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
dword-design authored Apr 30, 2023
1 parent 1e9ae3b commit 6285ff1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import fs from 'fs-extra'
import P from 'path'
import tsAstToLiteral from 'ts-ast-to-literal'
import ts from 'typescript'
import vueTemplateCompiler from 'vue-template-compiler'
import { parseComponent } from 'vue-template-compiler'

const predefinedProperties = {
components: true,
Expand All @@ -33,7 +33,7 @@ export default function () {

const Component =
P.extname(filename) === '.vue'
? vueTemplateCompiler.parseComponent(fileContent)
? parseComponent(fileContent)
: { script: { content: fileContent, lang: 'js' } }

const scriptContent = Component.script?.content
Expand Down

0 comments on commit 6285ff1

Please sign in to comment.