Commit f60906ce authored by Johnny's avatar Johnny

chore: tweak vite config

parent 5962c6d0
...@@ -43,12 +43,8 @@ export default defineConfig({ ...@@ -43,12 +43,8 @@ export default defineConfig({
build: { build: {
rollupOptions: { rollupOptions: {
output: { output: {
entryFileNames: "app.[hash].js", entryFileNames: "assets/app.[hash].js",
chunkFileNames: (chunkInfo) => { chunkFileNames: "assets/[name].[hash].js",
const facadeModuleId = chunkInfo.facadeModuleId ? chunkInfo.facadeModuleId.split("/") : [];
const name = facadeModuleId[facadeModuleId.length - 2] || "[name]";
return `assets/${name}/[name].[hash].js`;
},
assetFileNames: "assets/[name].[hash][extname]", assetFileNames: "assets/[name].[hash][extname]",
manualChunks: { manualChunks: {
"react-vendor": ["react", "react-dom", "react-router-dom"], "react-vendor": ["react", "react-dom", "react-router-dom"],
...@@ -57,7 +53,7 @@ export default defineConfig({ ...@@ -57,7 +53,7 @@ export default defineConfig({
"katex-vendor": ["katex"], "katex-vendor": ["katex"],
"highlight-vendor": ["highlight.js"], "highlight-vendor": ["highlight.js"],
"mermaid-vendor": ["mermaid"], "mermaid-vendor": ["mermaid"],
"map-vendor": ["leaflet", "react-leaflet"], "leaflet-vendor": ["leaflet", "react-leaflet"],
}, },
}, },
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment