Bin
2025-12-17 dcf780a91c16b6be28635b6e2e0e702060ee19f2
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
import wp from "@cypress/webpack-preprocessor";
 
const options = {
  webpackOptions: {
    resolve: {
      extensions: [".ts", ".tsx", ".js"],
      alias: {
        data: `${process.cwd()}/data`,
      },
    },
    module: {
      rules: [
        {
          test: /\.tsx?$/,
          loader: "ts-loader",
          options: { transpileOnly: true },
        },
      ],
    },
  },
};
 
/**
 * Allows importing typescript modules from `node_modules`
 * @param {Cypress.PluginEvents} on Event subscriber
 */
export const setupTypescript = (on) => {
  on("file:preprocessor", wp(options));
};