forked from aptabase/aptabase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
82 lines (81 loc) · 2.14 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
71
72
73
74
75
76
77
78
79
80
81
82
import react from "@vitejs/plugin-react-swc";
import path from "path";
import { defineConfig, splitVendorChunkPlugin } from "vite";
const pkg = require("./package.json");
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), splitVendorChunkPlugin()],
define: {
"import.meta.env.APP_VERSION": JSON.stringify(pkg.version),
},
publicDir: "webapp/public",
build: {
outDir: "wwwroot",
rollupOptions: {
output: {
manualChunks: {
react: ["react", "react-router-dom", "react-dom"],
chartjs: ["chart.js", "chartjs-plugin-annotation"],
highlight: ["rehype-highlight", "remark-gfm"],
},
},
},
},
server: {
port: 3000,
proxy: {
"/uploads": {
target: "http://localhost:5251",
changeOrigin: true,
secure: false,
},
"/api": {
target: "http://localhost:5251",
changeOrigin: true,
secure: false,
},
},
},
resolve: {
conditions: ["development", "browser"],
alias: [
{
find: "@app/env",
replacement: path.resolve(__dirname, "./webapp/pkg/env"),
},
{
find: "@app/billing",
replacement: path.resolve(__dirname, "./webapp/pkg/billing"),
},
{
find: "@app/support",
replacement: path.resolve(__dirname, "./webapp/pkg/support"),
},
{
find: "@app/primitives",
replacement: path.resolve(__dirname, "./webapp/pkg/primitives"),
},
{
find: "@app/theme",
replacement: path.resolve(__dirname, "./webapp/pkg/theme"),
},
{
find: "@app/navigation",
replacement: path.resolve(__dirname, "./webapp/pkg/navigation"),
},
{
find: "@app/apps",
replacement: path.resolve(__dirname, "./webapp/pkg/apps"),
},
{
find: "@app/auth",
replacement: path.resolve(__dirname, "./webapp/pkg/auth"),
},
{
find: "@app/widgets",
replacement: path.resolve(__dirname, "./webapp/pkg/widgets"),
},
{ find: "@app", replacement: path.resolve(__dirname, "./webapp/src") },
],
},
});