feat: 升级stylelint依赖并修复相关问题
- 更新stylelint到16.x版本 - 修复postcss版本冲突 - 解决循环依赖问题 - 优化代码类型定义
This commit is contained in:
@@ -36,6 +36,50 @@ export default defineConfig({
|
||||
define: {
|
||||
'process.env': {},
|
||||
},
|
||||
build: {
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks: {
|
||||
// 核心框架
|
||||
vendor: ['vue', 'vue-router', 'pinia'],
|
||||
// UI 框架
|
||||
arco: ['@arco-design/web-vue'],
|
||||
// 工具库
|
||||
utils: ['lodash', 'dayjs', 'axios'],
|
||||
// 图表库
|
||||
charts: ['echarts', 'vue-echarts'],
|
||||
// 持久化插件
|
||||
persist: ['pinia-plugin-persistedstate'],
|
||||
},
|
||||
// 优化 chunk 命名
|
||||
chunkFileNames: (chunkInfo) => {
|
||||
if (chunkInfo.name) {
|
||||
return `js/[name]-[hash].js`;
|
||||
}
|
||||
return `js/chunk-[hash].js`;
|
||||
},
|
||||
// 优化入口文件命名
|
||||
entryFileNames: 'js/[name]-[hash].js',
|
||||
// 优化资源文件命名
|
||||
assetFileNames: (assetInfo) => {
|
||||
if (assetInfo.name?.endsWith('.css')) {
|
||||
return 'css/[name]-[hash].css';
|
||||
}
|
||||
return 'assets/[name]-[hash].[ext]';
|
||||
},
|
||||
},
|
||||
},
|
||||
chunkSizeWarningLimit: 1000,
|
||||
// 压缩选项
|
||||
minify: 'terser',
|
||||
terserOptions: {
|
||||
compress: {
|
||||
// 移除 console 和 debugger
|
||||
drop_console: true,
|
||||
drop_debugger: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
less: {
|
||||
|
||||
Reference in New Issue
Block a user