Ashkan 8ddd697a07
fix(bundling): correctly handle .cjs.js .mjs.js in rollup for type definitions (#29366)
…le extensions for type definitions.

Updated the Rollup plugin's logic for generating type definition files
to ensure compatibility with additional file extensions, including
.cjs.js and .mjs.js.

This change improves the handling of entry points and ensures that
corresponding .d.ts files are correctly named and emitted in all
supported scenarios.

Added a comprehensive test case to validate the new behavior.

closed #29308

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Colum Ferry <cferry09@gmail.com>
2025-06-11 15:06:49 +01:00
..

Nx - Smart Repos · Fast Builds

{{links}}


Nx: Smart Repos · Fast Builds

An AI-first build platform that connects everything from your editor to CI. Helping you deliver fast, without breaking things.

This package is a JavaScript/TypeScript plugin for Nx.

{{content}}