fix: Add extensionAlias for ESM TS to webpack-batteries-included (#31994)

* chore: Add extensionAlias for ESM TS to webpack-batteries-included

For TypeScript ESM projects that use module resolution requiring file
extensions, `.js` extension must be used for `.ts` imports. Take
advantage of `resolve.extensionAlias` to resolve these imports.

Fixes #26827
Fixes #28805

* (Revisions) chore: Add extensionAlias for ESM TS to webpack-batteries-included

- Update typescript regex to allow .mts files
- Add ESM import tests

* chore: add changelog entry

* make sure extensionAlias is backwards compatible

---------

Co-authored-by: Bill Glesias <bglesias@gmail.com>
This commit is contained in:
Matt Mower
2025-07-16 09:25:19 -07:00
committed by GitHub
parent 60d4517465
commit cabdae708d
6 changed files with 25 additions and 4 deletions

View File

@@ -6,6 +6,7 @@ _Released 7/30/2025 (PENDING)_
**Bugfixes:**
- 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).
- Fixed an issue where TypeScript ESM projects using `.js` and `.mjs` extensions where not resolving correctly within `@cypress/webpack-batteries-included-preprocessor`. Addressed in [#31994](https://github.com/cypress-io/cypress/pull/31994).
## 14.5.2