Skip to content

Commit 43928f1

Browse files
committed
fix(ng_package): correct d.ts chunk file extension
When generating d.ts files with rollup, if a chunk name already contained `.d`, the output file would have a `.d.d.ts` extension. This change adjusts the output chunk file extension to `.ts` when in dts mode, preventing the double extension issue.
1 parent a84c272 commit 43928f1

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

pnpm-lock.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ng_package/rollup/rollup.config.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,6 @@ if (dtsMode) {
195195
);
196196
}
197197

198-
const outputExtension = dtsMode ? 'd.ts' : 'mjs';
199-
200198
/** @type {import('rollup').RollupOptions} */
201199
const config = {
202200
input,
@@ -217,8 +215,8 @@ const config = {
217215
minifyInternalExports: false,
218216
sourcemap: !dtsMode,
219217
banner: bannerContent,
220-
entryFileNames: `[name].${outputExtension}`,
221-
chunkFileNames: `[name].${outputExtension}`,
218+
entryFileNames: '[name].' + (dtsMode ? 'd.ts' : 'mjs'),
219+
chunkFileNames: '[name].' + (dtsMode ? 'ts' : 'mjs'),
222220
},
223221
};
224222

0 commit comments

Comments
 (0)