Skip to content

Commit

Permalink
fix: using correct global name in bundle (#8407)
Browse files Browse the repository at this point in the history
  • Loading branch information
trotyl authored and jelbourn committed Nov 20, 2017
1 parent a5b0872 commit 40be1f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tools/package-tools/build-bundles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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`),
Expand Down
3 changes: 2 additions & 1 deletion tools/package-tools/rollup-globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down

0 comments on commit 40be1f2

Please sign in to comment.