-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
60 lines (59 loc) · 1.57 KB
/
vite.config.ts
File metadata and controls
60 lines (59 loc) · 1.57 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 { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import path from "path";
import { URL } from "url";
export default defineConfig({
plugins: [
react()
],
resolve: {
alias: {
"@": path.resolve(path.dirname(new URL(import.meta.url).pathname), "client", "src"),
"@shared": path.resolve(path.dirname(new URL(import.meta.url).pathname), "shared"),
"@assets": path.resolve(path.dirname(new URL(import.meta.url).pathname), "attached_assets"),
},
},
optimizeDeps: {
include: [
"file-saver",
"react",
"react-dom",
"wouter",
],
},
root: path.resolve(path.dirname(new URL(import.meta.url).pathname), "client"),
build: {
outDir: path.resolve(path.dirname(new URL(import.meta.url).pathname), "dist"),
emptyOutDir: true,
sourcemap: true,
minify: true,
target: "es2020",
commonjsOptions: {
include: [/node_modules/],
transformMixedEsModules: true,
},
rollupOptions: {
onwarn(warning, warn) {
if (warning.code === "UNRESOLVED_IMPORT") return;
if (warning.code === "MISSING_EXPORT" && warning.exporter?.includes("react")) return;
warn(warning);
},
output: {
manualChunks: undefined,
format: "es",
entryFileNames: "assets/[name]-[hash].js",
chunkFileNames: "assets/[name]-[hash].js",
assetFileNames: "assets/[name]-[hash].[ext]",
},
},
},
server: {
port: 5004,
host: "0.0.0.0",
fs: {
strict: true,
deny: ["**/.*"],
},
middlewareMode: false,
},
});