-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.js
48 lines (46 loc) · 1.5 KB
/
vite.config.js
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
import { fileURLToPath, URL } from 'node:url'
import { join } from 'node:path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default ({mode}) => {
return defineConfig({
plugins: [
vue(),
],
base: '',
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'./asyncSocket.ts': join(process.cwd(), 'src', 'asyncWorkerSocket.ts'),
'socket.io-client': join(process.cwd(), 'src', 'asyncWorkerSocket.ts'),
}
},
define: {
// By default, Vite doesn't include shims for NodeJS/
// necessary for segment analytics lib to work
global: {},
APP_VERSION: JSON.stringify(process.env.npm_package_version),
REFL1D_WHEEL_FILE: JSON.stringify(process.env.REFL1D_WHEEL_FILE),
BUMPS_WHEEL_FILE: JSON.stringify(process.env.BUMPS_WHEEL_FILE),
},
worker: {
format: 'es',
rollupOptions: {
external: ["node-fetch"],
},
},
build: {
rollupOptions: {
output: {
// Default
// dir: (mode == 'standalone') ? 'dist_standalone': join('dist', process.env.npm_package_version),
entryFileNames: (mode == 'production') ? 'assets/[name].js' : 'assets/[name].[hash].js',
assetFileNames: (mode == 'production') ? 'assets/[name][extname]' : 'assets/[name].[hash][extname]',
// chunkFileNames: "chunk-[name].js",
// manualChunks: undefined,
}
}
}
})
}