fix: using correct global name in bundle (#8407)

This commit is contained in:
Trotyl Yu
2017-11-21 03:35:34 +08:00
committed by Jeremy Elbourn
parent a5b0872e07
commit 40be1f26e5
2 changed files with 4 additions and 3 deletions
+2 -2
View File
@@ -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`),
+2 -1
View File
@@ -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'));