forked from solidjs/solid-site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
41 lines (39 loc) · 1 KB
/
vite.config.ts
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 { defineConfig } from 'vite';
import solid from 'vite-plugin-solid';
import { VitePWA, Options as VitePWAOptions } from 'vite-plugin-pwa';
import manifest from './src/assets/manifest.json';
const pwaOptions: Partial<VitePWAOptions> = {
registerType: 'autoUpdate',
manifest,
workbox: {},
};
export default defineConfig({
plugins: [solid(), VitePWA(pwaOptions)],
optimizeDeps: {
include: [
'prismjs/components/prism-typescript',
'prismjs/components/prism-jsx',
'prismjs/components/prism-json',
'prismjs/components/prism-bash',
],
},
build: {
polyfillDynamicImport: false,
target: 'esnext',
terserOptions: {
compress: {
unsafe: true,
unsafe_arrows: true,
// unsafe_comps: true,
unsafe_Function: true,
unsafe_math: true,
unsafe_symbols: true,
unsafe_methods: true,
unsafe_proto: true,
unsafe_regexp: true,
// unsafe_undefined: true,
passes: 3,
},
},
},
});