-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
58 lines (57 loc) · 1.38 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import { defineConfig } from 'vite';
import solidPlugin from 'vite-plugin-solid';
import { VitePWA } from 'vite-plugin-pwa';
import icons from 'unplugin-icons/vite';
import tsconfigPaths from 'vite-tsconfig-paths';
import path from 'node:path';
export default defineConfig({
appType: 'spa',
base: '/project-nanase/',
resolve: {
alias: [
{
find: '@shadowrz/hanekokoro-ui/styled-system',
replacement: path.resolve(import.meta.dirname, 'styled-system'),
},
],
},
plugins: [
solidPlugin(),
icons({ compiler: 'solid' }),
tsconfigPaths({ root: './' }),
VitePWA({
srcDir: 'src',
filename: 'sw.ts',
strategies: 'injectManifest',
injectManifest: {
minify: false,
enableWorkboxModulesLogs: true,
rollupFormat: 'iife',
maximumFileSizeToCacheInBytes: 10_000_000,
},
devOptions: {
enabled: true,
type: 'module',
navigateFallback: 'index.html',
},
}),
],
server: {
port: 4000,
},
build: {
target: 'es2022',
rollupOptions: {
output: {
manualChunks: (id) => {
if (
id.includes('matrix-js-sdk/lib/rust-crypto') ||
id.includes('@matrix-org/matrix-sdk-crypto-wasm')
)
return 'project-nanase-rust-crypto';
return 'project-nanase';
},
},
},
},
});