-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathvite.config.ts
More file actions
49 lines (48 loc) · 1.37 KB
/
vite.config.ts
File metadata and controls
49 lines (48 loc) · 1.37 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
import react from '@vitejs/plugin-react'
import path, { resolve } from 'node:path'
import { defineConfig } from 'vite'
export default defineConfig({
plugins: [react()],
define: {
'process.env': JSON.stringify({ NODE_ENV: 'production' }),
},
resolve: {
alias: {
'@components': path.resolve(__dirname, './externals/components'),
'@modules': path.resolve(__dirname, './externals/modules'),
'@api': path.resolve(__dirname, './externals/api'),
'@hooks': path.resolve(__dirname, './externals/hooks'),
'@services': path.resolve(__dirname, './externals/services'),
'@utils': path.resolve(__dirname, './externals/utils'),
'@styles': resolve(__dirname, 'externals/styles'),
types: resolve(__dirname, 'externals/types'),
},
},
server: {
cors: {
origin: '*',
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
allowedHeaders: ['Content-Type', 'Authorization'],
credentials: false,
},
},
build: {
minify: false,
lib: {
entry: path.resolve(__dirname, 'src/sandbox-component.tsx'),
name: 'SandboxComponent',
fileName: 'sandbox-component',
formats: ['iife'],
},
rollupOptions: {
external: ['react', 'react-dom'],
output: {
globals: {
react: 'React',
'react-dom': 'ReactDOM',
},
},
},
watch: {},
},
})