Better code splitting
This commit is contained in:
+2
-8
@@ -13,14 +13,8 @@
|
||||
href="https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,600;1,400;1,600&family=Lato:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=DM+Mono&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<link href="https://fonts.googleapis.com/css2?family=DM+Mono&display=swap" rel="stylesheet" />
|
||||
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined" rel="stylesheet" />
|
||||
|
||||
<link rel="stylesheet" href="/node_modules/katex/dist/katex.css" />
|
||||
<link rel="stylesheet" href="/client/styles/main.scss" />
|
||||
|
||||
+16
-2
@@ -1,4 +1,4 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import { defineConfig, splitVendorChunkPlugin } from 'vite'
|
||||
|
||||
import dotenv from 'dotenv'
|
||||
import preact from '@preact/preset-vite'
|
||||
@@ -9,5 +9,19 @@ console.log(`[Config] BASE_URL = "${process.env.BASE_URL}"`)
|
||||
|
||||
export default defineConfig({
|
||||
base: process.env.BASE_URL,
|
||||
plugins: [preact()],
|
||||
build: {
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks(id) {
|
||||
if (id.includes('katex')) {
|
||||
return 'katex'
|
||||
}
|
||||
if (id.includes('unified') || id.includes('remark') || id.includes('rehype')) {
|
||||
return 'markdown'
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [splitVendorChunkPlugin(), preact()],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user