mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-09 23:53:41 +08:00
feat: 首页加载速度优化
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { defineConfig, transformWithEsbuild } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import { splitVendorChunkPlugin } from 'vite'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
@@ -19,7 +18,6 @@ export default defineConfig({
|
||||
},
|
||||
},
|
||||
react(),
|
||||
splitVendorChunkPlugin()
|
||||
],
|
||||
optimizeDeps: {
|
||||
force: true,
|
||||
@@ -33,11 +31,12 @@ export default defineConfig({
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks: {
|
||||
'react-vendor': ['react', 'react-dom'],
|
||||
'semi': ['@douyinfe/semi-ui'],
|
||||
'icons': ['@douyinfe/semi-icons'],
|
||||
'semantic': ['semantic-ui-react'],
|
||||
'visactor': ['@visactor/react-vchart', '@visactor/vchart']
|
||||
'react-core': ['react', 'react-dom', 'react-router-dom'],
|
||||
'semi-ui': ['@douyinfe/semi-icons', '@douyinfe/semi-ui'],
|
||||
'semantic': ['semantic-ui-css', 'semantic-ui-react'],
|
||||
'visactor': ['@visactor/react-vchart', '@visactor/vchart'],
|
||||
'tools': ['axios', 'history', 'marked'],
|
||||
'react-components': ['react-dropzone', 'react-fireworks', 'react-telegram-login', 'react-toastify', 'react-turnstile'],
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user