提交 036f8ac5 编写于 作者: fxy060608's avatar fxy060608

fix(h5): throw parse error (inject plugin)

上级 ba6eab4a
......@@ -88,18 +88,8 @@ export function uniViteInjectPlugin(
debugInjectTry(id)
if (code.search(firstpass) === -1) return null
if (sep !== '/') id = id.split(sep).join('/')
let ast = null
try {
ast = this.parse(code)
} catch (err) {
this.warn({
code: 'PARSE_ERROR',
message: `plugin-inject: failed to parse ${id}. Consider restricting the plugin to particular files via options.include`,
})
}
if (!ast) {
return null
}
const ast = this.parse(code)
const imports = new Set()
;(ast as unknown as Program).body.forEach((node) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册