@@ -18,6 +18,38 @@ export default defineConfig(configEnv => {
18
18
const enableProxy = configEnv . command === 'serve' && ! configEnv . isPreview ;
19
19
return {
20
20
base : viteEnv . VITE_BASE_URL ,
21
+ build : {
22
+ rollupOptions : {
23
+ output : {
24
+ assetFileNames : chunkInfo => {
25
+ const name = chunkInfo . name ;
26
+
27
+ if ( name ?. endsWith ( '.css' ) ) {
28
+ return 'css/[name]-[hash].css' ;
29
+ }
30
+
31
+ const imgExts = [ 'png' , 'jpg' , 'jpeg' , 'gif' , 'svg' , 'webp' ] ;
32
+
33
+ if ( imgExts . some ( ext => name ?. endsWith ( `.${ ext } ` ) ) ) {
34
+ return 'images/[name]-[hash].[ext]' ;
35
+ }
36
+
37
+ return 'assets/[name]-[hash].[ext]' ;
38
+ } ,
39
+ chunkFileNames : 'js/[name]-[hash].js' ,
40
+ entryFileNames : 'js/[name]-[hash].js' ,
41
+ manualChunks : {
42
+ animate : [ 'motion' ] ,
43
+ antd : [ 'antd' , '@ant-design/v5-patch-for-react-19' ] ,
44
+ axios : [ 'axios' ] ,
45
+ react : [ 'react' , 'react-dom' , 'react-error-boundary' ] ,
46
+ reactRouter : [ 'react-router-dom' ] ,
47
+ redux : [ 'react-redux' , '@reduxjs/toolkit' ] ,
48
+ sa : [ '@sa/axios' , '@sa/color' , '@sa/hooks' , '@sa/materials' , '@sa/utils' ]
49
+ }
50
+ }
51
+ }
52
+ } ,
21
53
css : {
22
54
preprocessorOptions : {
23
55
scss : {
0 commit comments