-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathvite.config.ts
More file actions
90 lines (88 loc) · 2.49 KB
/
vite.config.ts
File metadata and controls
90 lines (88 loc) · 2.49 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { sentryVitePlugin } from "@sentry/vite-plugin";
import pkg from "./package.json";
import path from "path";
import { VitePWA } from "vite-plugin-pwa";
export default defineConfig(({ mode }) => {
return {
plugins: [
react(),
sentryVitePlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: "dev-bcn",
project: "devbcn",
}),
VitePWA({
registerType: "autoUpdate",
includeAssets: [
"favicon.ico",
"apple-touch-icon.png",
"maskable_icon_x192.png",
],
manifest: {
name: "DevBcn",
short_name: "DevBcn",
description: "DevBcn - The developer conference in Barcelona",
theme_color: "#ffffff",
icons: [
{
src: "logo192.png",
sizes: "192x192",
type: "image/png",
},
{
src: "logo512.png",
sizes: "512x512",
type: "image/png",
},
],
},
}),
],
resolve: {
alias: {
// Path aliases matching those in tsconfig.json
"@components": path.resolve(__dirname, "./src/components"),
"@config": path.resolve(__dirname, "./src/config"),
"@constants": path.resolve(__dirname, "./src/constants"),
"@services": path.resolve(__dirname, "./src/services"),
"@hooks": path.resolve(__dirname, "./src/hooks"),
"@/assets": path.resolve(__dirname, "./src/assets"),
"@styles": path.resolve(__dirname, "./src/styles"),
"@views": path.resolve(__dirname, "./src/views"),
"@utils": path.resolve(__dirname, "./src/utils"),
"@data": path.resolve(__dirname, "./src/data"),
"@/types": path.resolve(__dirname, "./src/types"),
"lucide-react": "lucide-react",
},
},
define: {
"process.env": {
NODE_ENV: JSON.stringify(mode),
npm_package_version: JSON.stringify(pkg.version),
},
},
build: {
outDir: "build",
sourcemap: true,
},
server: {
port: 3000, // Match CRA's default port
},
base: "/",
test: {
globals: true,
environment: "jsdom",
setupFiles: ["./src/setupTests.ts"],
css: true,
coverage: {
provider: "v8",
reporter: ["text", "json", "html", "lcov"],
},
},
optimizeDeps: {
exclude: ["lucide-react"],
},
};
});