-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
60 lines (54 loc) · 1.33 KB
/
vite.config.ts
File metadata and controls
60 lines (54 loc) · 1.33 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
52
53
54
55
56
57
58
59
60
import { defineConfig, loadEnv } from 'vite'
import dts from 'vite-plugin-dts';
import { resolve } from 'path'
import svgr from "vite-plugin-svgr";
// import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default ({ mode }) => {
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) };
return defineConfig({
resolve: {
alias: [{ find: '@', replacement: resolve(__dirname, '/src') }],
},
plugins: [
dts({
// entryRoot: './package/',
// outDir: './types/'
entryRoot: './package/',
}), svgr()
],
build: {
lib: {
entry: resolve(__dirname, './index.ts'),
// entry: resolve(__dirname, './src/lib/index.ts'),
formats: ['es', 'cjs', 'umd'],
name: 'visualizer-client',
fileName: 'index',
},
rollupOptions: {
external: [
"react",
"react-dom",
"react/jsx-runtime",
"d3",
"@chakra-ui/react",
"react-icons",
"tailwindcss"
],
},
},
css: {
postcss: {
plugins: [
require('tailwindcss')({
config: './tailwind.config.js'
}),
],
}
},
server: {
port: +(process.env.VITE_PORT || 5000),
},
base: process.env.VITE_BASE_PATH || "/",
})
}