Skip to content

Commit 09df12a

Browse files
slusarzcmouse
authored andcommitted
config: Split large data bundles into smaller chunks
1 parent a525a3e commit 09df12a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.vitepress/config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { pagefindPlugin } from 'vitepress-plugin-pagefind'
44
import { generateSidebar } from 'vitepress-sidebar'
55
import { dovecotMdExtend } from '../lib/markdown.js'
66
import { getExcludes } from '../lib/utility.js'
7+
import path from 'path'
78

89
const base = '/2.4'
910
const base_url = 'https://doc.dovecot.org'
@@ -60,6 +61,18 @@ export default defineConfig({
6061
vite: {
6162
build: {
6263
chunkSizeWarningLimit: 1000,
64+
rollupOptions: {
65+
output: {
66+
manualChunks(id) {
67+
if (id.startsWith(path.resolve(process.cwd(), 'lib/data'))) {
68+
return 'data-chunk-' + path.basename(id, '.data.js')
69+
}
70+
if (id.includes('node_modules')) {
71+
return 'vendor'
72+
}
73+
}
74+
}
75+
}
6376
},
6477
plugins: [
6578
pagefindPlugin()

0 commit comments

Comments
 (0)