-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress.config.ts
39 lines (37 loc) · 1.23 KB
/
cypress.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
31
32
33
34
35
36
37
38
39
import { defineConfig } from "cypress";
import webpackPreprocessor from "@cypress/webpack-preprocessor";
import { NormalModuleReplacementPlugin } from "webpack";
import path from "path";
export default defineConfig({
fileServerFolder: "public",
chromeWebSecurity: false,
component: {
chromeWebSecurity: false,
defaultCommandTimeout: 60000,
fileServerFolder: "assets",
setupNodeEvents(on, config) {
// Import the necessary plugins within this function
on("file:preprocessor", async (file) => {
const webpackOptions = await import("./webpack.config.cjs");
const options: any = {
webpackOptions: webpackOptions.default,
watchOptions: {},
};
return webpackPreprocessor(options)(file);
});
// For example, setting up a webpack preprocessor:
/* const options: any = {
// Specify webpack options here
webpackOptions: ,
watchOptions: {},
};
on("file:preprocessor", webpackPreprocessor(options)); */
// Return the updated config object
return config;
},
devServer: {
framework: "react",
bundler: "webpack",
},
},
});