Skip to content

Commit c7d1291

Browse files
clydinalan-agius4
authored andcommitted
refactor(@angular-devkit/build-angular): remove unneeded esbuild external packages workaround
Version 0.19 of esbuild added the ability to consider tsconfig path mappings when using the external packages build option. This addition allows the Angular build system to remove a resolve plugin that previously was used to workaround this limitation. Removal of the plugin may also provide improved rebuild performance when used with the development server as many of the JavaScript resolution attempts will no longer need to be handled by the now removed plugin.
1 parent 5345336 commit c7d1291

File tree

2 files changed

+2
-56
lines changed

2 files changed

+2
-56
lines changed

packages/angular_devkit/build_angular/src/tools/esbuild/application-code-bundle.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import type { NormalizedApplicationBuildOptions } from '../../builders/applicati
1313
import { allowMangle } from '../../utils/environment-options';
1414
import { SourceFileCache, createCompilerPlugin } from './angular/compiler-plugin';
1515
import { createCompilerPluginOptions } from './compiler-plugin-options';
16-
import { createExternalPackagesPlugin } from './external-packages-plugin';
1716
import { createRxjsEsmResolutionPlugin } from './rxjs-esm-resolution-plugin';
1817
import { createSourcemapIngorelistPlugin } from './sourcemap-ignorelist-plugin';
1918
import { getFeatureSupport } from './utils';
@@ -56,8 +55,7 @@ export function createBrowserCodeBundleOptions(
5655
};
5756

5857
if (options.externalPackages) {
59-
buildOptions.plugins ??= [];
60-
buildOptions.plugins.push(createExternalPackagesPlugin());
58+
buildOptions.packages = 'external';
6159
}
6260

6361
const polyfills = options.polyfills ? [...options.polyfills] : [];
@@ -156,7 +154,7 @@ export function createServerCodeBundleOptions(
156154

157155
buildOptions.plugins ??= [];
158156
if (options.externalPackages) {
159-
buildOptions.plugins.push(createExternalPackagesPlugin());
157+
buildOptions.packages = 'external';
160158
} else {
161159
buildOptions.plugins.push(createRxjsEsmResolutionPlugin());
162160
}

packages/angular_devkit/build_angular/src/tools/esbuild/external-packages-plugin.ts

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)