Skip to content

Commit

Permalink
refactor(@angular-devkit/build-angular): remove old `bundleDependenci…
Browse files Browse the repository at this point in the history
…es` enum logic

BREAKING CHANGE: server builder `bundleDependencies` option now only accept a boolean value.
  • Loading branch information
alan-agius4 committed Sep 8, 2022
1 parent 4f8a3d2 commit 7f1017e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 33 deletions.
2 changes: 1 addition & 1 deletion goldens/public-api/angular_devkit/build_angular/index.md
Expand Up @@ -244,7 +244,7 @@ export interface ProtractorBuilderOptions {

// @public (undocumented)
export interface ServerBuilderOptions {
bundleDependencies?: BundleDependenciesUnion;
bundleDependencies?: boolean;
deleteOutputPath?: boolean;
// @deprecated
deployUrl?: string;
Expand Down
23 changes: 0 additions & 23 deletions packages/angular_devkit/build_angular/src/builders/server/index.ts
Expand Up @@ -66,29 +66,6 @@ export function execute(
const baseOutputPath = path.resolve(root, options.outputPath);
let outputPaths: undefined | Map<string, string>;

if (typeof options.bundleDependencies === 'string') {
options.bundleDependencies = options.bundleDependencies === 'all';
context.logger.warn(
`Option 'bundleDependencies' string value is deprecated since version 9. Use a boolean value instead.`,
);
}

if (!options.bundleDependencies) {
// eslint-disable-next-line import/no-extraneous-dependencies
const { __processed_by_ivy_ngcc__, main = '' } = require('@angular/core/package.json');
if (
!__processed_by_ivy_ngcc__ ||
!__processed_by_ivy_ngcc__.main ||
(main as string).includes('__ivy_ngcc__')
) {
context.logger.warn(tags.stripIndent`
Warning: Turning off 'bundleDependencies' with Ivy may result in undefined behaviour
unless 'node_modules' are transformed using the standalone Angular compatibility compiler (NGCC).
See: https://angular.io/guide/ivy#ivy-and-universal-app-shell
`);
}
}

return from(initialize(options, context, transforms.webpackConfiguration)).pipe(
concatMap(({ config, i18n, target }) => {
return runWebpack(config, context, {
Expand Down
Expand Up @@ -184,15 +184,7 @@
"bundleDependencies": {
"description": "Which external dependencies to bundle into the bundle. By default, all of node_modules will be bundled.",
"default": true,
"oneOf": [
{
"type": "boolean"
},
{
"type": "string",
"enum": ["none", "all"]
}
]
"type": "boolean"
},
"externalDependencies": {
"description": "Exclude the listed external dependencies from being bundled into the bundle. Instead, the created bundle relies on these dependencies to be available during runtime.",
Expand Down

0 comments on commit 7f1017e

Please sign in to comment.