forked from wbopan/cui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.mts
More file actions
49 lines (48 loc) · 1.29 KB
/
Copy pathvite.config.mts
File metadata and controls
49 lines (48 loc) · 1.29 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
45
46
47
48
49
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
import { VitePWA } from 'vite-plugin-pwa'
import * as path from 'path'
export default defineConfig({
root: 'src/web',
plugins: [
react(),
tailwindcss(),
VitePWA({
registerType: 'autoUpdate',
includeAssets: ['favicon.svg', 'icon-192x192.png', 'icon-512x512.png'],
manifest: false, // Use our existing manifest.json
strategies: 'injectManifest',
srcDir: '.',
filename: 'sw.ts',
injectManifest: {
globPatterns: ['**/*.{js,css,html,ico,png,svg,json}'],
},
workbox: {
cleanupOutdatedCaches: true,
clientsClaim: true,
skipWaiting: true,
}
})
],
publicDir: '../../public',
resolve: {
alias: {
'@': path.resolve(__dirname, './src')
}
},
build: {
outDir: '../../dist/web',
emptyOutDir: true,
rollupOptions: {
input: {
main: path.resolve(__dirname, 'src/web/index.html')
}
}
},
server: {
port: 3000,
host: '0.0.0.0',
allowedHosts: ['wenbo-macbook.dala-cobia.ts.net', 'cui.wenbo.io', 'localhost', '127.0.0.1', 'cui1.wenbo.io', 'cui2.wenbo.io', 'cui.tai.chat', 'measurements-struggle-slight-campbell.trycloudflare.com'],
}
})