-
Notifications
You must be signed in to change notification settings - Fork 33
/
vite.config.ts
41 lines (38 loc) · 884 Bytes
/
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
import { defineConfig } from "vite";
import preact from "@preact/preset-vite";
import svgrPlugin from "./plugins/vite-plugin-svgr";
import * as path from "path";
export const projectRootDir = process.cwd();
export const resolveByProjectRootDir = (...pathSegments: string[]) => {
return path.resolve(projectRootDir, ...pathSegments);
};
export default defineConfig({
server: {
port: 8666,
hmr: true,
},
resolve: {
alias: {
"@pkg": resolveByProjectRootDir("src"),
},
},
plugins: [
preact({
exclude: [/blocky-core/, /node_modules/],
}),
svgrPlugin(),
],
build: {
target: "esnext",
outDir: "dist/renderer",
rollupOptions: {
input: {
index: "./index.html",
welcome: "./welcome.html",
},
},
},
optimizeDeps: {
exclude: ["blocky-common", "blocky-core", "blocky-preact"],
},
});