-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
60 lines (57 loc) · 1.43 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
58
59
60
import { resolve } from "path";
import preact from "@preact/preset-vite";
import { defineConfig } from "vite";
import moduleList from "./lib/main";
export default defineConfig({
plugins: [
// Library
moduleList({
rootPath: resolve("lib/types"),
outputPath: resolve("lib/types.ts"),
mode: { language: "ts", type: true },
}),
moduleList({
rootPath: resolve("lib/tools"),
outputPath: resolve("lib/tools.ts"),
mode: { language: "ts", extension: "js" },
}),
moduleList({
rootPath: resolve("lib/constants"),
outputPath: resolve("lib/constants.ts"),
mode: { language: "ts", extension: "js" },
}),
// Demo
moduleList({
rootPath: resolve("src/pages"),
outputPath: resolve("src/pages.ts"),
formatOptions: {
trailingComma: "all",
},
mode: {
language: "ts",
dynamic: true,
},
}),
moduleList({
rootPath: resolve("src/icons"),
includeExtensions: ["tsx"],
outputPath: resolve("src/icons.ts"),
mode: "ts",
}),
moduleList({
rootPath: resolve("src/types"),
outputPath: resolve("src/types.ts"),
mode: { language: "ts", type: true },
}),
moduleList({
rootPath: resolve("src/pages"),
includeExtensions: ["css"],
outputPath: resolve("src/pages.css"),
mode: "css",
}),
preact(),
],
clearScreen: false,
root: ".",
build: {},
});