-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
51 lines (50 loc) · 1.32 KB
/
vite.config.ts
File metadata and controls
51 lines (50 loc) · 1.32 KB
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
49
50
51
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'
export default defineConfig({
plugins: [react()],
server: {
host: '127.0.0.1',
// Proxy API calls to wrangler pages dev server in dev mode
proxy: {
'/api': {
target: 'http://127.0.0.1:8788',
changeOrigin: true,
rewrite: (p) => p,
},
},
},
// Include .wasm files as assets so they get correct MIME type
assetsInclude: ['**/*.wasm'],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@core': path.resolve(__dirname, './packages/core'),
'@toolbox/types': path.resolve(__dirname, './packages/types'),
'@it-toolbox/core': path.resolve(__dirname, './packages/core'),
'@it-toolbox/types': path.resolve(__dirname, './packages/types'),
},
},
optimizeDeps: {
esbuildOptions: {
target: 'esnext',
},
},
esbuild: {
target: 'esnext',
},
build: {
target: 'esnext',
rollupOptions: {
output: {
manualChunks: {
'react-vendor': ['react', 'react-dom'],
'router': ['@tanstack/react-router'],
'crypto-vendor': ['bcryptjs', 'jose'],
'text-vendor': ['diff', 'fuse.js'],
'data-vendor': ['papaparse', 'js-yaml', 'sql-formatter'],
},
},
},
},
})