From f1329628b9f515e671a6e912308cc3b8f986f7dc Mon Sep 17 00:00:00 2001 From: Patrick Maier Date: Tue, 3 Jun 2025 18:25:04 +0200 Subject: [PATCH 1/2] fix: check path for indexHtmlFile in onSpecsChange (#31819) indexHtmlFile supports absolute paths, so we need to check if the path is absolute before fetching it from the project root. --- npm/webpack-dev-server/src/CypressCTWebpackPlugin.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/npm/webpack-dev-server/src/CypressCTWebpackPlugin.ts b/npm/webpack-dev-server/src/CypressCTWebpackPlugin.ts index c80f3ab8c294..bcc7a4bd7586 100644 --- a/npm/webpack-dev-server/src/CypressCTWebpackPlugin.ts +++ b/npm/webpack-dev-server/src/CypressCTWebpackPlugin.ts @@ -118,8 +118,9 @@ export class CypressCTWebpackPlugin { // TODO: don't use a sync fs method here // eslint-disable-next-line no-restricted-syntax const utimesSync: UtimesSync = inputFileSystem.fileSystem.utimesSync ?? fs.utimesSync + const indexHtmlFilePath = path.isAbsolute(this.indexHtmlFile) ? this.indexHtmlFile : path.join(this.projectRoot, this.indexHtmlFile) - utimesSync(path.join(this.projectRoot, this.indexHtmlFile), new Date(), new Date()) + utimesSync(indexHtmlFilePath, new Date(), new Date()) } /** From 5942f31335185f3ef77dcefcdd1d84b4a2fbae99 Mon Sep 17 00:00:00 2001 From: Patrick Maier Date: Fri, 13 Jun 2025 19:05:55 +0200 Subject: [PATCH 2/2] Update CHANGELOG.md --- cli/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index 49da6eb71390..7d35cb4de91d 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -10,6 +10,7 @@ _Released 6/17/2025 (PENDING)_ **Bugfixes:** - Fixed an issue when using `Cypress.stop()` where a run may be aborted prior to receiving the required runner events causing Test Replay to not be available. Addresses [#31781](https://github.com/cypress-io/cypress/issues/31781). +- Fixed missing support for setting an absolute path for `component.indexHtmlFile` in `@cypress/webpack-dev-server`. Fixes [#31819](https://github.com/cypress-io/cypress/issues/31819). ## 14.4.1