Skip to content

Commit 01a875c

Browse files
committed
fix: use rollup file sanitization
1 parent 84f4bf1 commit 01a875c

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/ng_package/rollup/rollup.config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,16 @@ const config = {
214214
},
215215
},
216216
output: {
217+
// Rollup will add a `.d` as part of the filename instead of an extension.
218+
// This will avoid outputting `.d.d.ts`.
219+
sanitizeFileName: fileName => (fileName.endsWith('.d') ? fileName.slice(0, -2) : fileName),
217220
minifyInternalExports: false,
218221
sourcemap: !dtsMode,
219222
banner: bannerContent,
220223
entryFileNames: '[name].' + outExtension,
221-
// Hashing is needed as otherwise rollup will emit files with `.d.d.ts` in some cases.
222-
chunkFileNames: '[name]-[hash].' + outExtension,
224+
// Name this with `_` as this can be useful when examing the output structure
225+
// and also it makes it clearer for users if these are imported by accident.
226+
chunkFileNames: '_[name]-chunk.' + outExtension,
223227
},
224228
};
225229

0 commit comments

Comments
 (0)