-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfarm.config.ts
44 lines (39 loc) · 1.06 KB
/
farm.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
import { defineConfig } from "@farmfe/core";
import solidPlugin from "vite-plugin-solid";
import farmJsPluginPostcss from "@farmfe/js-plugin-postcss";
let useProdContent = true;
let useProdAssets = true;
let proxyObj: any = {};
if (useProdAssets) {
proxyObj["/auth"] = {
target: "http://localhost:8787", // Replace with your actual API server address
changeOrigin: true,
rewrite: (path: string) => path,
};
}
if (useProdContent) {
proxyObj["/api"] = {
target: "http://localhost:8787", // Replace with your actual API server address
changeOrigin: true,
rewrite: (path: string) => path,
};
}
export default defineConfig({
plugins: [farmJsPluginPostcss()],
vitePlugins: [
() => ({ vitePlugin: solidPlugin(), filters: ["\\.jsx$", "\\.tsx$"] }),
],
server: {
port: 3000,
proxy: proxyObj,
cors: true,
},
// build: {
// target: "esnext",
// minify: "esbuild",
// cssMinify: "lightningcss",
// },
// optimizeDeps: {
// exclude: ["solid-highlight", "highlightjs", "mathlive", "dockview-core"],
// },
});