-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.config.js
More file actions
34 lines (29 loc) · 777 Bytes
/
vite.config.js
File metadata and controls
34 lines (29 loc) · 777 Bytes
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
import react from '@vitejs/plugin-react';
import { defineConfig, loadEnv } from 'vite';
import { entryUrlPlugin } from './vite-plugin-entry-url.js';
export default defineConfig(({ command, mode }) => {
const env = loadEnv(mode, process.cwd(), '');
const plugins = [react(), entryUrlPlugin()];
return {
plugins,
base: command === 'build' ? '/dist/' : '/',
build: {
manifest: true,
sourcemap: true,
rollupOptions: {
input: {
main: './src/main.ts',
app: './src/app.ts',
index: './src/roots/index.tsx',
},
external: [],
},
},
server: {
host: true,
port: parseInt(env.VITE_SERVER_PORT || '5173', 10),
allowedHosts: true,
cors: true,
},
};
});