Skip to content

Commit 2105326

Browse files
devversionmmalerba
authored andcommitted
build: individual umd files include other entry-points. (#7976)
Currently every UMD file for a secondary-entry point inlines other secondary-entry points. This means that the individual secondary entry points can't be used properly in SystemJS apps. Other secondary entry-points that are part of the current build package **should** be only inlined for the primary entry-point UMD bundle. Fixes #7947
1 parent 76a6e7b commit 2105326

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tools/package-tools/build-bundles.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,12 @@ export class PackageBundler {
138138
let external = Object.keys(rollupGlobals);
139139
external.splice(external.indexOf('tslib'), 1);
140140

141-
// If each secondary entry-point is re-exported at the root, we want to exlclude those
142-
// secondary entry-points from the rollup globals because we want the UMD for this package
143-
// to include *all* of the sources for those entry-points.
144-
if (this.buildPackage.exportsSecondaryEntryPointsAtRoot) {
141+
// If each secondary entry-point is re-exported at the root, we want to exclude those
142+
// secondary entry-points from the rollup globals because we want the UMD for the
143+
// primary entry-point to include *all* of the sources for those entry-points.
144+
if (this.buildPackage.exportsSecondaryEntryPointsAtRoot &&
145+
config.moduleName === `ng.${this.buildPackage.name}`) {
146+
145147
const importRegex = new RegExp(`@angular/${this.buildPackage.name}/.+`);
146148
external = external.filter(e => !importRegex.test(e));
147149

0 commit comments

Comments
 (0)