-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Expand file tree
/
Copy pathvite.config.ts
More file actions
60 lines (56 loc) · 1.44 KB
/
Copy pathvite.config.ts
File metadata and controls
60 lines (56 loc) · 1.44 KB
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 { federation } from "@module-federation/vite";
import react from "@vitejs/plugin-react";
import * as dns from "dns";
import { defineConfig, loadEnv } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
dns.setDefaultResultOrder("verbatim");
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, __dirname, "");
return {
plugins: [
react(),
federation({
name: "host",
dts: false,
remotes: {
blog_posts: {
type: "module",
name: "blog_posts",
entry: "http://localhost:4001/remoteEntry.js",
entryGlobalName: "blog_posts",
shareScope: "default",
},
categories: {
type: "module",
name: "categories",
entry:
env.VITE_CATEGORIES_URL || "http://localhost:4002/remoteEntry.js",
entryGlobalName: "categories",
shareScope: "default",
},
},
filename: "remoteEntry.js",
shared: [
"react",
"react-dom",
"react-router",
"@refinedev/core",
"@refinedev/antd",
"antd",
],
}),
tsconfigPaths({ root: __dirname }),
],
preview: {
host: "localhost",
port: 4000,
strictPort: true,
},
build: {
target: "esnext",
minify: false,
cssCodeSplit: false,
},
};
});