diff --git a/tools/package-tools/build-bundles.ts b/tools/package-tools/build-bundles.ts index a68eba62e713..676770132a19 100644 --- a/tools/package-tools/build-bundles.ts +++ b/tools/package-tools/build-bundles.ts @@ -3,7 +3,7 @@ import {uglifyJsFile} from './minify-sources'; import {buildConfig} from './build-config'; import {BuildPackage} from './build-package'; import {rollupRemoveLicensesPlugin} from './rollup-remove-licenses'; -import {rollupGlobals} from './rollup-globals'; +import {rollupGlobals, dashCaseToCamelCase} from './rollup-globals'; // There are no type definitions available for these imports. const rollup = require('rollup'); @@ -51,7 +51,7 @@ export class PackageBundler { return this.bundleEntryPoint({ entryFile, esm5EntryFile, - moduleName: `ng.${packageName}.${entryPoint}`, + moduleName: `ng.${packageName}.${dashCaseToCamelCase(entryPoint)}`, esm2015Dest: join(bundlesDir, `${packageName}`, `${entryPoint}.js`), esm5Dest: join(bundlesDir, `${packageName}`, `${entryPoint}.es5.js`), umdDest: join(bundlesDir, `${packageName}-${entryPoint}.umd.js`), diff --git a/tools/package-tools/rollup-globals.ts b/tools/package-tools/rollup-globals.ts index c9222cbe77fd..1d08c970d5aa 100644 --- a/tools/package-tools/rollup-globals.ts +++ b/tools/package-tools/rollup-globals.ts @@ -3,7 +3,8 @@ import {getSubdirectoryNames} from './secondary-entry-points'; import {buildConfig} from './build-config'; /** Method that converts dash-case strings to a camel-based string. */ -const dashCaseToCamelCase = (str: string) => str.replace(/-([a-z])/g, (g) => g[1].toUpperCase()); +export const dashCaseToCamelCase = + (str: string) => str.replace(/-([a-z])/g, (g) => g[1].toUpperCase()); /** List of potential secondary entry-points for the cdk package. */ const cdkSecondaryEntryPoints = getSubdirectoryNames(join(buildConfig.packagesDir, 'cdk'));