Skip to content

Commit 40be1f2

Browse files
trotyljelbourn
authored andcommitted
fix: using correct global name in bundle (#8407)
1 parent a5b0872 commit 40be1f2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tools/package-tools/build-bundles.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {uglifyJsFile} from './minify-sources';
33
import {buildConfig} from './build-config';
44
import {BuildPackage} from './build-package';
55
import {rollupRemoveLicensesPlugin} from './rollup-remove-licenses';
6-
import {rollupGlobals} from './rollup-globals';
6+
import {rollupGlobals, dashCaseToCamelCase} from './rollup-globals';
77

88
// There are no type definitions available for these imports.
99
const rollup = require('rollup');
@@ -51,7 +51,7 @@ export class PackageBundler {
5151
return this.bundleEntryPoint({
5252
entryFile,
5353
esm5EntryFile,
54-
moduleName: `ng.${packageName}.${entryPoint}`,
54+
moduleName: `ng.${packageName}.${dashCaseToCamelCase(entryPoint)}`,
5555
esm2015Dest: join(bundlesDir, `${packageName}`, `${entryPoint}.js`),
5656
esm5Dest: join(bundlesDir, `${packageName}`, `${entryPoint}.es5.js`),
5757
umdDest: join(bundlesDir, `${packageName}-${entryPoint}.umd.js`),

tools/package-tools/rollup-globals.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import {getSubdirectoryNames} from './secondary-entry-points';
33
import {buildConfig} from './build-config';
44

55
/** Method that converts dash-case strings to a camel-based string. */
6-
const dashCaseToCamelCase = (str: string) => str.replace(/-([a-z])/g, (g) => g[1].toUpperCase());
6+
export const dashCaseToCamelCase =
7+
(str: string) => str.replace(/-([a-z])/g, (g) => g[1].toUpperCase());
78

89
/** List of potential secondary entry-points for the cdk package. */
910
const cdkSecondaryEntryPoints = getSubdirectoryNames(join(buildConfig.packagesDir, 'cdk'));

0 commit comments

Comments
 (0)