feat: 更新 ESLint 和 Vite 配置以优化开发体验

- 在 .eslintrc.cjs 中允许在所有环境中使用 console 语句,避免构建警告
- 在 vite.config.js 中提升 chunk 大小限制以消除 UI 库的警告,并明确本地组件的导入设置
This commit is contained in:
Wangnov
2025-09-11 18:03:33 +08:00
parent 8522d20cad
commit 22e27738aa
2 changed files with 7 additions and 2 deletions

View File

@@ -18,7 +18,8 @@ module.exports = {
rules: {
'vue/multi-word-component-names': 'off',
'vue/no-v-html': 'off',
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
// 允许在所有环境中使用 console 语句以避免构建警告
'no-console': 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'prettier/prettier': 'error',
'vue/attributes-order': [

View File

@@ -51,7 +51,9 @@ export default defineConfig(({ mode }) => {
imports: ['vue', 'vue-router', 'pinia']
}),
Components({
resolvers: [ElementPlusResolver()]
// 仅自动注册 Element Plus 组件;本地组件显式导入
resolvers: [ElementPlusResolver()],
dirs: []
})
],
resolve: {
@@ -103,6 +105,8 @@ export default defineConfig(({ mode }) => {
build: {
outDir: 'dist',
assetsDir: 'assets',
// 提升 chunk 大小限制以消除 UI 库的大量警告
chunkSizeWarningLimit: 1024,
rollupOptions: {
output: {
manualChunks(id) {