Skip to content

Commit

Permalink
perf: 优化打包
Browse files Browse the repository at this point in the history
  • Loading branch information
huangmingfu committed Dec 24, 2024
1 parent 5d0e317 commit d62b3d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
output: {
chunkFileNames: 'js/[name]-[hash].js', // chunk包输出的文件夹名称
entryFileNames: 'js/[name]-[hash].js', // 入口文件输出的文件夹名称
assetFileNames: '[ext]/[name]-[hash].[ext]', // 静态文件输出的文件夹名称
assetFileNames: 'assets/[ext]/[name]-[hash].[ext]', // 静态文件输出的文件夹名称
// 手动分包,将第三方库拆分到单独的chunk包中(注意这些包名必须存在,否则打包会报错)
manualChunks: {
'vendor-react': ['react', 'react-dom', 'react-router'],
Expand Down

0 comments on commit d62b3d4

Please sign in to comment.