-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvite.config.ts
70 lines (66 loc) · 2.38 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
61
62
63
64
65
66
67
68
69
70
import { defineConfig } from "vite";
import dts from "vite-plugin-dts";
import svgr from "vite-plugin-svgr";
import react from "@vitejs/plugin-react-swc";
import path, { resolve } from "path";
import preserveDirectives from "rollup-preserve-directives";
import tailwindcss from "tailwindcss";
export default defineConfig({
build: {
lib: {
entry: {
index: resolve(__dirname, "./src/index.ts"),
client: resolve(__dirname, "./src/client.ts"),
hooks: resolve(__dirname, "./src/hooks/index.ts"),
icons: resolve(__dirname, "./src/assets/icons/index.ts"),
lib: resolve(__dirname, "./src/lib/index.ts"),
mocks: resolve(__dirname, "./src/mocks/handlers.ts"),
types: resolve(__dirname, "./src/types/index.ts"),
// features
application: resolve(__dirname, "./src/features/application/index.ts"),
checker: resolve(__dirname, "./src/features/checker/index.ts"),
pool: resolve(__dirname, "./src/features/pool/index.ts"),
program: resolve(__dirname, "./src/features/program/index.ts"),
project: resolve(__dirname, "./src/features/project/index.ts"),
retrofunding: resolve(__dirname, "./src/features/retrofunding/index.ts"),
},
name: "gitcoin-ui",
fileName: (format: any, filename: any) => `${filename}.js`,
formats: ["es"],
},
rollupOptions: {
external: ["react", "react-dom", "tailwindcss"],
output: {
globals: {
react: "React",
"react-dom": "ReactDOM",
tailwindcss: "tailwindcss",
},
preserveModules: true,
preserveModulesRoot: "src",
},
plugins: [preserveDirectives()],
},
sourcemap: true,
emptyOutDir: true,
minify: false,
target: "esnext",
},
plugins: [react(), svgr(), dts({ rollupTypes: true })],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
"~checker": path.resolve(__dirname, "./src/features/checker"),
"~retrofunding": path.resolve(__dirname, "./src/features/retrofunding"),
"~pool": path.resolve(__dirname, "./src/features/pool"),
"~application": path.resolve(__dirname, "./src/features/application"),
"~program": path.resolve(__dirname, "./src/features/program"),
"~project": path.resolve(__dirname, "./src/features/project"),
},
},
css: {
postcss: {
plugins: [tailwindcss],
},
},
});