web/build: merge i18n chunks for each language into one file

This commit is contained in:
dumbmoron 2024-07-04 22:15:15 +00:00
parent 422b907703
commit e98f76c8ee
No known key found for this signature in database

View file

@ -5,6 +5,20 @@ export default defineConfig({
plugins: [
sveltekit()
],
build: {
rollupOptions: {
output: {
manualChunks: (id) => {
if (id.includes('/web/i18n')) {
const lang = id.split('/web/i18n/')?.[1].split('/')?.[0];
if (lang) {
return `i18n_${lang}`;
}
}
}
}
}
},
server: {
fs: {
allow: [