-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathvite.config.ts
More file actions
41 lines (40 loc) · 1.04 KB
/
Copy pathvite.config.ts
File metadata and controls
41 lines (40 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import {sveltekit} from '@sveltejs/kit/vite';
import {SvelteKitPWA} from '@vite-pwa/sveltekit';
import {defineConfig} from 'vite';
export default defineConfig({
plugins: [
sveltekit(),
SvelteKitPWA({
registerType: 'prompt',
includeAssets: ['favicon.ico', 'favicon.svg', 'favicon.png', 'robots.txt', 'manifest.webmanifest'],
manifest: false,
workbox: {
cleanupOutdatedCaches: true,
globPatterns: [
'client/**/*.{js,css,ico,png,svg,webp,webmanifest,mjs}',
'prerendered/**/*.{html,json}'
],
maximumFileSizeToCacheInBytes: 12 * 1024 * 1024
}
})
],
build: {
rollupOptions: {
output: {
manualChunks: (id) => {
if (id.includes('pdfjs-dist')) {
return 'pdf-worker';
}
if (id.includes('pdf-lib')) {
return 'pdf-lib';
}
if (id.includes('node_modules')) {
return 'vendor';
}
}
}
},
target: 'es2020',
chunkSizeWarningLimit: 1000
}
});