Make alias imports work in cypress.

This commit is contained in:
Jay
2025-08-01 23:50:24 -04:00
parent f639876604
commit 33f6a7e0c2
4 changed files with 14 additions and 7 deletions
+7 -2
View File
@@ -1,9 +1,12 @@
import { defineConfig } from "cypress";
import vitePreprocessor from "cypress-vite";
import { mergeConfig } from "vite";
import viteConfig from "./vite.config";
export default defineConfig({
e2e: {
setupNodeEvents(on, config) {
setupNodeEvents(on, _) {
on("file:preprocessor", vitePreprocessor());
},
baseUrl: "http://localhost:5173",
@@ -13,10 +16,12 @@ export default defineConfig({
devServer: {
framework: "react",
bundler: "vite",
viteConfig: {
viteConfig: () => {
return mergeConfig(viteConfig, {
server: {
port: 5174,
},
});
},
},
},
+2
View File
@@ -7,6 +7,8 @@
"build:wasm": "wasm-pack build colorlib -t bundler -d pkg --release",
"clean": "rm -rf dist colorlib/pkg*",
"cypress:open": "1>/dev/null 2>/dev/null cypress open -d &",
"cypress:component": "cypress run --component",
"cypress:e2e": "cypress run --e2e",
"dev": "vite",
"lint": "eslint .",
"preview": "vite preview",
+1 -1
View File
@@ -20,5 +20,5 @@
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": ["vite.config.ts"]
"include": ["vite.config.ts", "cypress.config.ts"]
}
+1 -1
View File
@@ -1,6 +1,6 @@
import react from "@vitejs/plugin-react";
import path from "path";
import * as path from "path";
import { defineConfig } from "vite";
import topLevelAwait from "vite-plugin-top-level-await";
import wasm from "vite-plugin-wasm";