Skip to content

Commit

Permalink
⚙️ config: 调整类型声明文件的作用位置,在app内作用;
Browse files Browse the repository at this point in the history
  • Loading branch information
ruan-cat committed Sep 30, 2024
1 parent e746ad5 commit d240117
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 30 deletions.
3 changes: 2 additions & 1 deletion learn-create-compoents-lib/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"./types": "./types/index.d.ts",
"./lib/*": "./lib/*",
"./es/*": "./es/*",
"./src/*": "./src/*"
"./src/*": "./src/*",
"./global.d.ts": "./global.d.ts"
},
"scripts": {
"build": "gulp -f build/gulpfile.js",
Expand Down
59 changes: 36 additions & 23 deletions learn-create-compoents-lib/test-app/tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,37 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,
"jsx": "preserve",

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"]
}
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": [
"ES2020",
"DOM",
"DOM.Iterable"
],
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,
"jsx": "preserve",
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"types": [
// 主动导入该内容 确实可以实现类型声明 可以让vue组件内对应用的组件提供类型声明
// "@giegie/components/global.d.ts",
// TODO: 让下面的类型文件 实现组件的识别与扫描。
"./components.d.ts",
"./auto-imports.d.ts"
]
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue"
]
}
7 changes: 1 addition & 6 deletions learn-create-compoents-lib/test-app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
}
],
"compilerOptions": {
"types": [
// "@giegie/components/global.d.ts"
// "@giegie/components"
"./components.d.ts",
"./auto-imports.d.ts"
]
"types": []
}
}

0 comments on commit d240117

Please sign in to comment.