forked from jeyoder/StuffInSpace
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathvite.config.js
35 lines (32 loc) · 933 Bytes
/
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
// eslint-disable-next-line import/no-extraneous-dependencies
import { defineConfig, loadEnv, splitVendorChunkPlugin } from 'vite';
import { visualizer } from 'rollup-plugin-visualizer';
import { threeMinifier } from '@yushijinhun/three-minifier-rollup';
import path from 'path';
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
return {
// vite config
define: {
__APP_ENV__: env.APP_ENV
},
root: __dirname,
publicDir: 'public',
build: {
outDir: 'dist'
},
base: env.BASE_URL || './',
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@satellite-viewer': path.resolve(__dirname, './src/viewer')
},
},
plugins: [
// TODO attempting to reduce threejs bundle size. Still a WIP
{ ...threeMinifier(), enforce: 'pre' },
splitVendorChunkPlugin(),
visualizer()
]
};
});