!192 chore: 标准化tsconfig和优化postcss配置

Merge pull request !192 from yangxu52/feture/standardize
This commit is contained in:
疯狂的狮子Li 2025-03-07 05:19:20 +00:00 committed by Gitee
commit 9d7f3101b9
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 37 additions and 31 deletions

View File

@ -1,5 +1,5 @@
{ {
"$schema": "https://json.schemastore.org/tsconfig", "$schema": "https://json.schemastore.org/package",
"name": "ruoyi-vue-plus", "name": "ruoyi-vue-plus",
"version": "5.3.0", "version": "5.3.0",
"description": "RuoYi-Vue-Plus多租户管理系统", "description": "RuoYi-Vue-Plus多租户管理系统",
@ -52,6 +52,7 @@
"@types/crypto-js": "4.2.2", "@types/crypto-js": "4.2.2",
"@types/file-saver": "2.0.7", "@types/file-saver": "2.0.7",
"@types/js-cookie": "3.0.6", "@types/js-cookie": "3.0.6",
"@types/node": "^22.13.4",
"@types/nprogress": "0.2.3", "@types/nprogress": "0.2.3",
"@unocss/preset-attributify": "66.0.0", "@unocss/preset-attributify": "66.0.0",
"@unocss/preset-icons": "66.0.0", "@unocss/preset-icons": "66.0.0",
@ -67,7 +68,7 @@
"globals": "16.0.0", "globals": "16.0.0",
"prettier": "3.5.2", "prettier": "3.5.2",
"sass": "1.84.0", "sass": "1.84.0",
"typescript": "5.7.3", "typescript": "~5.7.3",
"unocss": "66.0.0", "unocss": "66.0.0",
"unplugin-auto-import": "0.17.5", "unplugin-auto-import": "0.17.5",
"unplugin-icons": "0.18.5", "unplugin-icons": "0.18.5",
@ -78,10 +79,16 @@
"vite-plugin-svg-icons-ng": "1.0.2", "vite-plugin-svg-icons-ng": "1.0.2",
"vite-plugin-vue-devtools": "7.7.1", "vite-plugin-vue-devtools": "7.7.1",
"vitest": "3.0.5", "vitest": "3.0.5",
"vue-tsc": "2.2.0" "vue-tsc": "^2.2.2"
}, },
"engines": { "engines": {
"node": ">=18.18.0", "node": ">=18.18.0",
"npm": ">=8.9.0" "npm": ">=8.9.0"
} },
"browserslist": [
"Chrome >= 87",
"Edge >= 88",
"Safari >= 14",
"Firefox >= 78"
]
} }

View File

@ -1,31 +1,35 @@
{ {
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": { "compilerOptions": {
"target": "esnext", "baseUrl": ".",
"module": "esnext", // https://vite.dev/config/build-options.html#build-target
// "useDefineForClassFields": true, "target": "ES2020",
"moduleResolution": "bundler", "module": "ESNext",
"moduleResolution": "Bundler",
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"skipLibCheck": true,
// This setting lets you specify a file for storing incremental compilation information as a part of composite projects which enables faster building of larger TypeScript codebases.
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.tsbuildinfo",
"strict": true, "strict": true,
"allowJs": true,
"jsx": "preserve", "jsx": "preserve",
"strictNullChecks": false,
"sourceMap": true, "sourceMap": true,
"resolveJsonModule": true, "resolveJsonModule": true,
"esModuleInterop": true, "esModuleInterop": true,
"strictFunctionTypes": false, "noEmit": true,
"lib": ["esnext", "dom"],
"noImplicitAny": false,
"baseUrl": ".",
"allowJs": true,
"experimentalDecorators": true,
"paths": { "paths": {
"@/*": ["src/*"] "@/*": ["./src/*"]
}, },
"types": ["vite/client"], "types": ["node", "vite/client"],
"skipLibCheck": true, //
"removeComments": true, "noImplicitAny": false, // any
// "removeComments": true, // ts
"allowSyntheticDefaultImports": true, "experimentalDecorators": true, //
"forceConsistentCasingInFileNames": true "strictFunctionTypes": false, //
"strictNullChecks": false, //
"allowSyntheticDefaultImports": true, //
"forceConsistentCasingInFileNames": true // 使
}, },
"include": ["src/**/*.ts", "src/**/*.vue", "src/types/**/*.d.ts", "vite.config.ts"], "include": ["src/**/.ts", "src/**/*.vue", "vite.config.ts", "vitest.config.ts", "eslint.config.ts"],
"exclude": ["node_modules", "dist", "**/*.js", "**/*.md", "src/**/*.md"] "exclude": ["node_modules", "dist", "src/**/__tests__/*"]
} }

View File

@ -12,7 +12,6 @@ export default defineConfig(({ mode, command }) => {
base: env.VITE_APP_CONTEXT_PATH, base: env.VITE_APP_CONTEXT_PATH,
resolve: { resolve: {
alias: { alias: {
'~': path.resolve(__dirname, './'),
'@': path.resolve(__dirname, './src') '@': path.resolve(__dirname, './src')
}, },
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'] extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
@ -43,19 +42,15 @@ export default defineConfig(({ mode, command }) => {
postcss: { postcss: {
plugins: [ plugins: [
// 浏览器兼容性 // 浏览器兼容性
autoprefixer({ autoprefixer(),
overrideBrowserslist: ['Android 4.1', 'iOS 7.1', 'Chrome > 31', 'ff > 31', 'ie >= 8']
}),
{ {
postcssPlugin: 'internal:charset-removal', postcssPlugin: 'internal:charset-removal',
AtRule: { AtRule: {
charset: (atRule) => { charset: (atRule) => {
if (atRule.name === 'charset') {
atRule.remove(); atRule.remove();
} }
} }
} }
}
] ]
} }
}, },