-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
57 lines (55 loc) · 1.52 KB
/
vite.config.ts
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
import AutoImport from 'unplugin-auto-import/vite';
import { defineConfig } from 'vite';
import solid from 'vite-plugin-solid';
import devtools from 'solid-devtools/vite';
export default defineConfig({
plugins: [
devtools({
autoname: true,
}),
solid(),
// NOTE: autoimport detects file changes automatically
// but "unimport", its parent plugin, does not
AutoImport({
// include: [
// /\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
// ],
dirs: ['./src/**/*'],
imports: [
'solid-js',
'@solidjs/router',
{
from: 'solid-js',
imports: ['ParentComponent', 'Component'],
type: true,
},
// { from: 'pixi.js', imports: [['*', 'PIXI']], type: true },
{
'pixi.js': [['*', 'PIXI']],
},
// in the next build, type imports can probably be scanned
// automatically
// {
// from: './src/pixi/context.ts',
// imports: ['IPixiContext'],
// type: true,
// },
// { name: '*', as: 'PIXI', from: 'pixi.js' },
],
// presets: [
// 'solid-js',
// // {
// // package: 'pixi.js',
// // // type
// // // ignore: ['isStream', /^[A-Z]/, /^[a-z]*$/, (r) => r.length > 8],
// // },
// ],
// dts: './src/auto-imports.d.ts',
dts: true,
}),
],
build: {
minify: false,
target: 'esnext', // support top level await (or we can use vite-top-level-await plugin)
},
});