Make alias imports work in cypress.
This commit is contained in:
+7
-2
@@ -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,
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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
@@ -20,5 +20,5 @@
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noUncheckedSideEffectImports": true
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
"include": ["vite.config.ts", "cypress.config.ts"]
|
||||
}
|
||||
|
||||
+1
-1
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user