@denaro-config/tsconfig
v1.4.11
Published
前端工程化中的 tsconfig 通用配置, 提供多种打包场景的 tsconfig 配置, 您可以执行进行继承使用。
Downloads
102
Maintainers
Readme
@denaro-config/tsconfig
:tada: 前端工程化中的 tsconfig 通用配置, 提供多种打包场景的 tsconfig 配置, 您可以执行进行继承使用。
参考官网地址
安装至您的项目
npm install -D @denaro-config/tsconfig
# or
pnpm install -D @denaro-config/tsconfig
# or
yarn add -D @denaro-config/tsconfig
使用
在项目根目录下创建 tsconfig.json
文件, 参考配置内容如下:
- CommonJS
{
"extends": "@denaro-config/tsconfig/tsconfig.json"
}
- ESNext
{
"extends": "@denaro-config/tsconfig/tsconfig.esnext.json"
}
- Vue3
{
"extends": "@denaro-config/tsconfig/tsconfig.vue3.json"
}
Vite+Vue 项目
tsconfig.json
{
"files": [],
"references": [
{
"path": "./tsconfig.node.json"
},
{
"path": "./tsconfig.app.json"
}
]
}
tsconfig.app.json
{
"extends": "@denaro-config/tsconfig/tsconfig.vue3.json",
"include": [
"env.d.ts",
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue",
"tests/**/*.ts",
"tests/**/*.tsx"
],
"exclude": ["src/**/__tests__/*", "node_modules", "lib", "dist"]
}
tsconfig.node.json
{
"extends": "@denaro-config/tsconfig/tsconfig.node.json",
"include": [
"vite.config.*",
"vitest.config.*",
"cypress.config.*",
"nightwatch.conf.*",
"playwright.config.*"
]
}
结合 eslint 使用
参考 typescript