Closed
Description
- I have searched the issues of this repository and believe that this is not a duplicate.
Version
2.0.0-beta.5
Environment
vue: 3.0.0-rc.10
vue-loader: 16.0.0-beta.7
Reproduction link
https://github.com/kagawagao/antdv-vue-loader-16
Steps to reproduce
见示例仓库
What is expected?
能正常运行
What is actually happening?
编译失败
[email protected]
之后用了 compiler-sfc
的 compileScript
来编译 script
代码,导致需要增加额外的插件来支持 jsx
,因此编译失败
// vue-loader
try {
script = (descriptor as any).scriptCompiled = compileScript(descriptor, {
babelParserPlugins: options.babelParserPlugins
})
} catch (e) {
loaderContext.emitError(e)
}
// compiler-sfc
const scriptAst = parse(script.content, {
plugins,
sourceType: 'module'
}).program.body
return {
...script,
content: hasCssVars ? injectCssVarsCalls(sfc, plugins) : script.content,
bindings: analyzeScriptBindings(scriptAst),
scriptAst
}