diff --git a/packages/babel-plugin-resolve-type/package.json b/packages/babel-plugin-resolve-type/package.json index c4311ff..e61d42d 100644 --- a/packages/babel-plugin-resolve-type/package.json +++ b/packages/babel-plugin-resolve-type/package.json @@ -8,6 +8,13 @@ "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/index.mjs", + "require": "./dist/index.js" + }, + "./package.json": "./package.json" + }, "repository": { "type": "git", "url": "git+https://github.com/vuejs/babel-plugin-jsx" @@ -30,7 +37,7 @@ "@babel/helper-module-imports": "^7.22.5", "@babel/parser": "^7.22.11", "@babel/plugin-syntax-typescript": "^7.22.5", - "@vue/compiler-sfc": "link:/Users/kevin/Developer/open-source/vue/vue-core/packages/compiler-sfc" + "@vue/compiler-sfc": "^3.3.4" }, "devDependencies": { "@babel/core": "^7.22.11", diff --git a/packages/babel-plugin-resolve-type/src/index.ts b/packages/babel-plugin-resolve-type/src/index.ts index 928291a..2528876 100644 --- a/packages/babel-plugin-resolve-type/src/index.ts +++ b/packages/babel-plugin-resolve-type/src/index.ts @@ -38,7 +38,7 @@ export default ({ const props = comp.params[0]; if (!props) return; - if (props.type === 'AssignmentPattern' && 'typeAnnotation' in props.left) { + if (props.type === 'AssignmentPattern') { ctx!.propsTypeDecl = getTypeAnnotation(props.left); ctx!.propsRuntimeDefaults = props.right; } else { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fb2d8ef..7cc2dcd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -129,8 +129,8 @@ importers: specifier: ^7.22.5 version: 7.22.5(@babel/core@7.22.20) '@vue/compiler-sfc': - specifier: link:/Users/kevin/Developer/open-source/vue/vue-core/packages/compiler-sfc - version: link:../../../vue-core/packages/compiler-sfc + specifier: ^3.3.4 + version: 3.3.4 devDependencies: '@babel/core': specifier: ^7.22.11