diff --git a/packages/compiler-sfc/package.json b/packages/compiler-sfc/package.json index 980ba41f..5374e39f 100644 --- a/packages/compiler-sfc/package.json +++ b/packages/compiler-sfc/package.json @@ -35,6 +35,7 @@ }, "dependencies": { "@babel/parser": "^7.10.4", + "@babel/types": "^7.10.4", "@vue/compiler-core": "3.0.0-beta.20", "@vue/compiler-dom": "3.0.0-beta.20", "@vue/compiler-ssr": "3.0.0-beta.20", diff --git a/packages/compiler-sfc/src/compileScript.ts b/packages/compiler-sfc/src/compileScript.ts index aabf4b3a..f358ddb9 100644 --- a/packages/compiler-sfc/src/compileScript.ts +++ b/packages/compiler-sfc/src/compileScript.ts @@ -11,6 +11,7 @@ import { ExpressionStatement, ArrowFunctionExpression, ExportSpecifier, + TSType, TSTypeLiteral, TSFunctionType, TSDeclareFunction @@ -25,6 +26,8 @@ export interface SFCScriptCompileOptions { parserPlugins?: ParserPlugin[] } +let hasWarned = false + /** * Compile `