-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvite.config.ts
40 lines (39 loc) · 961 Bytes
/
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
import { defineConfig } from 'vite';
import path from 'path';
import react from '@vitejs/plugin-react-swc';
import { VitePWA } from 'vite-plugin-pwa';
import { ViteImageOptimizer } from 'vite-plugin-image-optimizer';
import eslint from 'vite-plugin-eslint';
// https://vitejs.dev/config/
export default defineConfig({
base: '/',
plugins: [
react(),
eslint(),
ViteImageOptimizer(),
VitePWA({
registerType: 'autoUpdate',
// Cache our game assets, like images and sfx
includeAssets: ['src/assets/**/*'],
workbox: {
globPatterns: [
'**/*.{js,css,html,png}',
],
// Ignore websocket caching by ignoring non-http/s requests
// This will prevent PlayroomKit requests from being cached.
ignoreURLParametersMatching: [/^http/],
},
}),
],
define: {
'process.env.NODE_ENV': `'${process.env.NODE_ENV}'`,
},
server: {
port: 3000,
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src/'),
},
},
});