Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwooding committed Aug 15, 2024
1 parent 51a96e9 commit f199284
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"env": {
"test": {
"plugins": ["istanbul"]
}
}
}
6 changes: 3 additions & 3 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import installCoverageTask from "@cypress/code-coverage/task";
import { defineConfig } from "cypress";
import { devServer } from "cypress-rspack-dev-server";
import { merge } from "webpack-merge";

export default defineConfig({
viewportWidth: 1280,
Expand All @@ -25,12 +26,11 @@ export default defineConfig({
return devServer({
...devServerConfig,
framework: "react",
rspackConfig: {
...require("./rspack.config").default,
rspackConfig: merge(require("./rspack.config").default, {
experiments: {
lazyCompilation: !devServerConfig.cypressConfig.isTextTerminal,
},
},
}),
});
},
specPattern: "packages/**/src/**/*.cy.{js,ts,jsx,tsx}",
Expand Down
10 changes: 10 additions & 0 deletions rspack.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import path from "node:path";
import { defineConfig } from "@rspack/cli";
import { version as reactVersion } from "react";

const prod = true;

Expand All @@ -15,6 +16,10 @@ export default defineConfig({
test: /\.css$/,
use: ["style-loader", "css-loader", "postcss-loader"],
},
{
test: /packages\/.*\/src\/.*\.[tj]sx?$/,
use: ["babel-loader"],
},
{
test: /\.(j|t)s$/,
exclude: [/[\\/]node_modules[\\/]/],
Expand Down Expand Up @@ -63,6 +68,11 @@ export default defineConfig({
configFile: path.resolve(__dirname, "./tsconfig.json"),
references: "auto",
},
alias: {
"cypress/react18": reactVersion.startsWith("18")
? "cypress/react18"
: "cypress/react",
},
extensions: ["...", ".ts", ".tsx", ".js", ".jsx", ".css"],
},
});

0 comments on commit f199284

Please sign in to comment.