-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathvite.config.mjs
More file actions
74 lines (73 loc) · 1.61 KB
/
vite.config.mjs
File metadata and controls
74 lines (73 loc) · 1.61 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import { defineConfig } from "vite";
import federation from "@originjs/vite-plugin-federation";
import path from "path";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
export default defineConfig({
plugins: [
federation({
name: "care_abdm",
filename: "remoteEntry.js",
exposes: {
"./manifest": "./src/manifest.ts",
},
shared: [
"react",
"react-dom",
"react-i18next",
"@tanstack/react-query",
"raviger",
"sonner",
],
}),
tailwindcss(),
react(),
],
server: {
port: 5173,
allowedHosts: true,
host: "0.0.0.0",
cors: true,
headers: {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS",
"Access-Control-Allow-Headers": "*",
},
},
build: {
target: "esnext",
minify: false,
cssCodeSplit: false,
modulePreload: {
polyfill: false,
},
rollupOptions: {
external: [],
input: {
main: "./src/index.ts",
},
output: {
format: "esm",
entryFileNames: "assets/[name].js",
chunkFileNames: "assets/[name].js",
},
},
},
preview: {
port: 5173,
allowedHosts: true,
host: "0.0.0.0",
cors: true,
headers: {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS",
"Access-Control-Allow-Headers": "*",
},
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
envPrefix: "REACT_",
});