Skip to content

Commit 8ff4c7d

Browse files
fix: check path for indexHtmlFile in onSpecsChange (#31819) (#31821)
* 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. * Update CHANGELOG.md * Update CHANGELOG.md updates changelog ref to 14.5.3 --------- Co-authored-by: Bill Glesias <bglesias@gmail.com>
1 parent f422950 commit 8ff4c7d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

cli/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
<!-- See the ../guides/writing-the-cypress-changelog.md for details on writing the changelog. -->
2+
## 14.5.3
3+
4+
_Released 7/30/2025 (PENDING)_
5+
6+
**Bugfixes:**
7+
8+
- 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).
9+
210
## 14.5.2
311

412
_Released 7/15/2025_

npm/webpack-dev-server/src/CypressCTWebpackPlugin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ export class CypressCTWebpackPlugin {
118118
// TODO: don't use a sync fs method here
119119
// eslint-disable-next-line no-restricted-syntax
120120
const utimesSync: UtimesSync = inputFileSystem.fileSystem.utimesSync ?? fs.utimesSync
121+
const indexHtmlFilePath = path.isAbsolute(this.indexHtmlFile) ? this.indexHtmlFile : path.join(this.projectRoot, this.indexHtmlFile)
121122

122-
utimesSync(path.join(this.projectRoot, this.indexHtmlFile), new Date(), new Date())
123+
utimesSync(indexHtmlFilePath, new Date(), new Date())
123124
}
124125

125126
/**

0 commit comments

Comments
 (0)