Skip to content

Commit 27330b2

Browse files
committed
✨ feat(vite配置优化): 调整vite.config.ts中的文件命名规则,使用[name]-[hash]格式以增强文件安全性和可追溯性,同时注释掉vendor分组以简化代码结构。
1 parent f097111 commit 27330b2

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

vite.config.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ export default defineConfig({
5050
rollupOptions: {
5151
output: {
5252
// 使用更安全的文件命名,不暴露库名
53-
chunkFileNames: 'static/js/[hash].js',
54-
entryFileNames: 'static/js/[hash].js',
53+
chunkFileNames: 'static/js/[name]-[hash].js',
54+
entryFileNames: 'static/js/[name]-[hash].js',
5555
// 按文件类型进行拆分文件夹
56-
assetFileNames: 'static/[ext]/[hash].[ext]',
56+
assetFileNames: 'static/[ext]/[name]-[hash].[ext]',
5757
// 使用 rolldown 的 advancedChunks 进行高级代码分割
5858
advancedChunks: {
5959
groups: [
@@ -85,10 +85,10 @@ export default defineConfig({
8585
name: 'other-vendor',
8686
test: /node_modules[\\/](classnames|@iconify-icon|i18next)/,
8787
},
88-
{
89-
name: 'vendor',
90-
test: /node_modules/,
91-
},
88+
// {
89+
// name: 'vendor',
90+
// test: /node_modules/,
91+
// },
9292
],
9393
},
9494
},

0 commit comments

Comments
 (0)