-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
44 lines (39 loc) · 1.11 KB
/
vite.config.js
File metadata and controls
44 lines (39 loc) · 1.11 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
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
import { resolve } from "path";
const FLASK_PORT = 7777;
export default defineConfig(({ mode }) => ({
base: mode === "production" ? "/src/dist/" : "/",
publicDir: false,
plugins: [react(), tailwindcss()],
server: {
port: 5173,
cors: {
origin: `http://localhost:${FLASK_PORT}`,
credentials: true,
},
allowedHosts: ["localhost"],
hmr: {
clientPort: 5173,
},
},
build: {
outDir: "src/dist",
manifest: true,
minify: true,
chunkSizeWarningLimit: 2000,
rollupOptions: {
input: {
global: resolve(__dirname, "src/static/css/global.css"),
__main__: resolve(__dirname, "src/static/js/mount_points/__main__.ts"),
__auth__: resolve(__dirname, "src/static/js/mount_points/__auth__.ts"),
},
output: {
entryFileNames: "assets/planchette-[hash:12].js",
chunkFileNames: "assets/planchette-[hash:12].js",
assetFileNames: "assets/planchette-[hash:12][extname]",
},
},
},
}));