-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
33 lines (32 loc) · 852 Bytes
/
vite.config.ts
File metadata and controls
33 lines (32 loc) · 852 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
// vite.config.ts
import { defineConfig } from 'vite'
import path from 'path'
export default defineConfig({
root: 'src',
server: {
host: "0.0.0.0",
port: 4000
},
build: {
outDir: '../dist',
emptyOutDir: true,
sourcemap: true,
minify: 'esbuild', // Use esbuild for minification (default)
assetsDir: 'assets',
rollupOptions: {
input: path.resolve(__dirname, 'src/index.html'),
output: {
assetFileNames: 'assets/[name]-[hash][extname]' // Hashing for cache busting
}
}
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'), // Optional alias for cleaner imports
}
},
define: {
'process.env.NODE_ENV': '"production"' // Inject environment variables
},
publicDir: path.resolve(__dirname, 'public'), // Serve static assets from the public directory
})