-
-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy pathvite.config.ts
30 lines (29 loc) · 1.11 KB
/
vite.config.ts
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
import path from "path";
import {defineConfig, loadEnv} from "vite";
import react from "@vitejs/plugin-react";
// https://vitejs.dev/config/
export default defineConfig(({mode}) => {
const env = loadEnv(mode, process.cwd(), "");
return {
plugins: [react()],
define: {
"process.env": env,
},
// /!\ vite randomly causes Cypress to fail with following err:
// Failed to fetch dynamically imported module: http://localhost:3000/__cypress/src/cypress/support/component.ts
// When Cypress detects uncaught errors originating from your test code it will automatically fail the current test.
// Cypress could not associate this error to any specific test. We dynamically generated a new test to display this failure.
// There is currently no official fix but This line is what stabilizes it better: https://github.com/cypress-io/cypress/issues/25913#issuecomment-1751222165
optimizeDeps: {
entries: ["cypress/**/*", "src/**/*"],
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
build: {
outDir: "build",
},
};
});