We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cc923dc commit 4d7eac1Copy full SHA for 4d7eac1
lib/parse-component.js
@@ -21,6 +21,8 @@ const transformHtml = require("./transform-html")
21
// Helpers
22
//------------------------------------------------------------------------------
23
24
+const STARTS_WITH_LT = /^\s*</
25
+
26
/**
27
* Parse the given component.
28
*
@@ -138,7 +140,9 @@ function parse(code, options) {
138
140
const filePath = options.filePath
139
141
const scriptOptions = options
142
const templateOptions = options.template || {}
- const isVue = path.extname(filePath || "unknown.js") === ".vue"
143
+ const isVue =
144
+ path.extname(filePath || "unknown.js") === ".vue" ||
145
+ STARTS_WITH_LT.test(code)
146
const scriptParser = new ScriptParser(code, scriptOptions)
147
let ast = null
148
0 commit comments