mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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
This commit is contained in:
committed by
mmalerba
parent
76a6e7beab
commit
2105326c46
@@ -138,10 +138,12 @@ export class PackageBundler {
|
||||
let external = Object.keys(rollupGlobals);
|
||||
external.splice(external.indexOf('tslib'), 1);
|
||||
|
||||
// If each secondary entry-point is re-exported at the root, we want to exlclude those
|
||||
// secondary entry-points from the rollup globals because we want the UMD for this package
|
||||
// to include *all* of the sources for those entry-points.
|
||||
if (this.buildPackage.exportsSecondaryEntryPointsAtRoot) {
|
||||
// If each secondary entry-point is re-exported at the root, we want to exclude those
|
||||
// secondary entry-points from the rollup globals because we want the UMD for the
|
||||
// primary entry-point to include *all* of the sources for those entry-points.
|
||||
if (this.buildPackage.exportsSecondaryEntryPointsAtRoot &&
|
||||
config.moduleName === `ng.${this.buildPackage.name}`) {
|
||||
|
||||
const importRegex = new RegExp(`@angular/${this.buildPackage.name}/.+`);
|
||||
external = external.filter(e => !importRegex.test(e));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user