-
Notifications
You must be signed in to change notification settings - Fork 380
Expand file tree
/
Copy pathvite.config.js
More file actions
87 lines (86 loc) · 2.14 KB
/
vite.config.js
File metadata and controls
87 lines (86 loc) · 2.14 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'
import dts from 'vite-plugin-dts'
import { viteStaticCopy } from 'vite-plugin-static-copy'
export default defineConfig({
plugins: [
react(),
dts({
insertTypesEntry: true,
declarationMap: true,
tsconfigPath: './tsconfig.build.json',
}),
viteStaticCopy({
targets: [
{
src: 'src/styles/design',
dest: 'styles',
},
{
src: 'tailwind.base.config.js',
dest: 'configs',
},
{
src: 'tailwind.lineage.config.js',
dest: 'configs',
},
],
}),
],
resolve: {
alias: {
'@sqlmesh-common': path.resolve(__dirname, './src'),
},
},
build: {
cssMinify: true,
lib: {
entry: {
'sqlmesh-common': path.resolve(__dirname, 'src/index.ts'),
'lineage/index': path.resolve(
__dirname,
'src/components/Lineage/index.ts',
),
},
name: 'sqlmesh-common',
fileName: (format, entryName) =>
({
'sqlmesh-common': `sqlmesh-common.${format}.js`,
'lineage/index': `lineage/index.${format}.js`,
})[entryName],
},
rollupOptions: {
external: [
'react',
'react-dom',
'clsx',
'tailwind-merge',
'class-variance-authority',
'@radix-ui/react-slot',
'tailwindcss',
'@tailwindcss/typography',
'@xyflow/react',
],
output: {
globals: {
react: 'React',
'react-dom': 'ReactDOM',
clsx: 'clsx',
'tailwind-merge': 'tailwindMerge',
'class-variance-authority': 'classVarianceAuthority',
'@radix-ui/react-slot': 'radixSlot',
'@xyflow/react': 'xyflowReact',
},
assetFileNames: assetInfo => {
if (assetInfo.name && assetInfo.name.endsWith('.css')) {
return 'styles/[name].min[extname]'
}
return '[name][extname]'
},
},
},
sourcemap: process.env.NODE_ENV !== 'production',
outDir: 'dist',
},
})