-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathvite.config.ts
More file actions
66 lines (63 loc) · 1.41 KB
/
vite.config.ts
File metadata and controls
66 lines (63 loc) · 1.41 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
import { defineConfig } from 'vite'
function packageAlias(packageName: string) {
return [
{
find: `@io-gui/${packageName}`,
replacement: new URL(
`./packages/${packageName}/src/index.ts`,
import.meta.url,
).pathname,
},
{
find: new RegExp(`/packages/${packageName}/dist/demos/(.*)\\.js$`),
replacement: new URL(
`./packages/${packageName}/src/demos/$1.ts`,
import.meta.url,
).pathname,
},
{
find: './dist/index.js',
replacement: './src/index.ts',
},
]
}
export const resolveConfig = {
alias: [
...packageAlias('core'),
...packageAlias('icons'),
...packageAlias('colors'),
...packageAlias('editors'),
...packageAlias('inputs'),
...packageAlias('layout'),
...packageAlias('markdown'),
...packageAlias('menus'),
...packageAlias('navigation'),
...packageAlias('sliders'),
...packageAlias('three'),
{
find: /\/packages\/three\/dist\/examples\/(.*)\.js$/,
replacement: new URL(
'./packages/three/src/examples/$1.ts',
import.meta.url,
).pathname,
},
],
}
export default defineConfig({
root: '.',
server: {
port: 3000,
watch: {
ignored: ['**/packages/three/src_examples/**'],
},
},
build: {
target: 'esnext',
},
optimizeDeps: {
esbuildOptions: {
target: 'esnext',
},
},
resolve: resolveConfig,
})