mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix: using correct global name in bundle (#8407)
This commit is contained in:
committed by
Jeremy Elbourn
parent
a5b0872e07
commit
40be1f26e5
@@ -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`),
|
||||
|
||||
@@ -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'));
|
||||
|
||||
Reference in New Issue
Block a user