forked from udplabs/cic-app-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
32 lines (29 loc) · 817 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
import { defineConfig, loadEnv } from 'vite';
import mixPlugin from 'vite-plugin-mix';
const mix = mixPlugin.default;
export default defineConfig(({ command, mode }) => {
Object.assign(process.env, loadEnv(mode, process.cwd(), ''));
const { VITE_APP_PORT: port, APP_ENV } = process?.env;
return {
plugins: [
mix({ handler: './server.js' })
],
define: {
__APP_ENV__: APP_ENV,
},
server: {
port,
},
build: {
// generate manifest.json in outDir
manifest: true,
modulePreload: {
polyfill: false,
},
rollupOptions: {
// overwrite default .html entry
input: './main.js',
},
},
};
});