From 51a96e979e0bd43e9785a75294b6bfb3e12d56c9 Mon Sep 17 00:00:00 2001 From: Josh Wooding <12938082+joshwooding@users.noreply.github.com> Date: Thu, 15 Aug 2024 13:40:51 +0100 Subject: [PATCH] Update configs --- cypress.config.ts | 8 +++++++- package.json | 2 +- rspack.config.ts | 7 ++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/cypress.config.ts b/cypress.config.ts index b0f7139129e..14256fc75b6 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -9,7 +9,7 @@ export default defineConfig({ video: false, component: { setupNodeEvents(on, config) { - installCoverageTask(on, config); + // installCoverageTask(on, config); //Setting up a log task to allow logging to the console during an axe test because console.log() does not work directly in a test on("task", { log(message: string) { @@ -25,6 +25,12 @@ export default defineConfig({ return devServer({ ...devServerConfig, framework: "react", + rspackConfig: { + ...require("./rspack.config").default, + experiments: { + lazyCompilation: !devServerConfig.cypressConfig.isTextTerminal, + }, + }, }); }, specPattern: "packages/**/src/**/*.cy.{js,ts,jsx,tsx}", diff --git a/package.json b/package.json index 904f3876993..eaa8e2e531e 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "copy:icon:css": "yarn workspace @salt-ds/icons copy:css", "copy:countries:css": "yarn workspace @salt-ds/countries copy:css", "test": "vitest", - "test:components": "cypress run --component --browser chrome --headless", + "test:components": "cypress run --component --browser chrome", "test:components:local": "cypress open --component --browser electron", "prettier": "prettier --write .", "prettier:ci": "prettier --check .", diff --git a/rspack.config.ts b/rspack.config.ts index c6e106a1eb6..f4319bc6994 100644 --- a/rspack.config.ts +++ b/rspack.config.ts @@ -7,6 +7,10 @@ export default defineConfig({ target: "browserslist", module: { rules: [ + { + test: /\.png$/, + type: "asset", + }, { test: /\.css$/, use: ["style-loader", "css-loader", "postcss-loader"], @@ -61,7 +65,4 @@ export default defineConfig({ }, extensions: ["...", ".ts", ".tsx", ".js", ".jsx", ".css"], }, - experiments: { - lazyCompilation: true, - }, });