-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
44 lines (43 loc) · 1.31 KB
/
vite.config.ts
File metadata and controls
44 lines (43 loc) · 1.31 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
42
43
44
import { purgeCss } from 'vite-plugin-tailwind-purgecss';
import { sveltekit } from '@sveltejs/kit/vite';
import { SvelteKitPWA } from '@vite-pwa/sveltekit';
import { defineConfig } from 'vite';
import pkg from './package.json';
export default defineConfig({
plugins: [
sveltekit(),
SvelteKitPWA({
registerType: 'autoUpdate',
injectRegister: 'inline',
workbox: {
globPatterns: ['**/*.{js,wasm,css,ico,png,svg,webp,webmanifest}', '**/*.html'],
maximumFileSizeToCacheInBytes: 10 * 1024 ** 2,
navigationPreload: true,
runtimeCaching: [
{
urlPattern: /\.(?:js|wasm|css|png|jpg|jpeg|svg|woff2)$/,
handler: 'CacheFirst',
options: {
cacheName: 'index-cache',
},
},
{
urlPattern: /.*/,
handler: 'NetworkFirst',
},
],
// navigateFallbackDenylist: [/pth/]
},
}),
purgeCss(),
],
define: {
__APP_NAME__: JSON.stringify(pkg.name),
__APP_VERSION__: JSON.stringify(pkg.version),
__BUILD_TYPE__: JSON.stringify(process.env.BUILD_TYPE)
},
optimizeDeps: {
//exclude: ['./src/lib/vendor/LegitScriptWasm.js', './src/lib/vendor/LegitScriptWasm.js']
},
//ssr: { noExternal: ['./src/lib/vendor/LegitScriptWasm.js'] }
});