Skip to content

Commit 565179e

Browse files
alan-agius4dgp1130
authored andcommitted
refactor: remove usage of internal plugin browser option from esbuild plugins
This option is no longer needed as `autoprefixer` is no longer used in the esbuild pipeline following #25457
1 parent 095f5ab commit 565179e

File tree

7 files changed

+2
-21
lines changed

7 files changed

+2
-21
lines changed

packages/angular_devkit/build_angular/src/builders/application/execute-build.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export async function executeBuild(
6262
new BundlerContext(
6363
workspaceRoot,
6464
!!options.watch,
65-
createBrowserCodeBundleOptions(options, target, browsers, codeBundleCache),
65+
createBrowserCodeBundleOptions(options, target, codeBundleCache),
6666
),
6767
);
6868

@@ -72,7 +72,6 @@ export async function executeBuild(
7272
const bundleOptions = createGlobalStylesBundleOptions(
7373
options,
7474
target,
75-
browsers,
7675
initial,
7776
codeBundleCache?.loadResultCache,
7877
);
@@ -107,7 +106,6 @@ export async function executeBuild(
107106
// NOTE: earlier versions of Node.js are not supported due to unsafe promise patching.
108107
// See: https://github.com/angular/angular/pull/50552#issue-1737967592
109108
[...target, 'node18.13'],
110-
browsers,
111109
codeBundleCache,
112110
),
113111
() => false,

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,13 @@ import { createVirtualModulePlugin } from './virtual-module-plugin';
2121
export function createBrowserCodeBundleOptions(
2222
options: NormalizedApplicationBuildOptions,
2323
target: string[],
24-
browsers: string[],
2524
sourceFileCache?: SourceFileCache,
2625
): BuildOptions {
2726
const { workspaceRoot, entryPoints, outputNames, jit } = options;
2827

2928
const { pluginOptions, styleOptions } = createCompilerPluginOptions(
3029
options,
3130
target,
32-
browsers,
3331
sourceFileCache,
3432
);
3533

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ type CreateCompilerPluginParameters = Parameters<typeof createCompilerPlugin>;
1414
export function createCompilerPluginOptions(
1515
options: NormalizedApplicationBuildOptions,
1616
target: string[],
17-
browsers: string[],
1817
sourceFileCache?: SourceFileCache,
1918
): {
2019
pluginOptions: CreateCompilerPluginParameters[0];
@@ -63,7 +62,6 @@ export function createCompilerPluginOptions(
6362
target,
6463
inlineStyleLanguage,
6564
preserveSymlinks,
66-
browsers,
6765
tailwindConfiguration,
6866
},
6967
};

packages/angular_devkit/build_angular/src/tools/esbuild/global-styles.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import { createVirtualModulePlugin } from './virtual-module-plugin';
1616
export function createGlobalStylesBundleOptions(
1717
options: NormalizedApplicationBuildOptions,
1818
target: string[],
19-
browsers: string[],
2019
initial: boolean,
2120
cache?: LoadResultCache,
2221
): BuildOptions | undefined {
@@ -62,7 +61,6 @@ export function createGlobalStylesBundleOptions(
6261
bundles: '[name]',
6362
},
6463
includePaths: stylePreprocessorOptions?.includePaths,
65-
browsers,
6664
tailwindConfiguration,
6765
},
6866
cache,

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import { createVirtualModulePlugin } from './virtual-module-plugin';
2525
export function createServerCodeBundleOptions(
2626
options: NormalizedApplicationBuildOptions,
2727
target: string[],
28-
browsers: string[],
2928
sourceFileCache: SourceFileCache,
3029
): BuildOptions {
3130
const { jit, serverEntryPoint, workspaceRoot } = options;
@@ -38,7 +37,6 @@ export function createServerCodeBundleOptions(
3837
const { pluginOptions, styleOptions } = createCompilerPluginOptions(
3938
options,
4039
target,
41-
browsers,
4240
sourceFileCache,
4341
);
4442

packages/angular_devkit/build_angular/src/tools/esbuild/stylesheets/bundle-options.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export interface BundleStylesheetOptions {
3131
includePaths?: string[];
3232
externalDependencies?: string[];
3333
target: string[];
34-
browsers: string[];
3534
tailwindConfiguration?: { file: string; package: string };
3635
}
3736

@@ -50,7 +49,6 @@ export function createStylesheetBundleOptions(
5049
sourcemap: !!options.sourcemap,
5150
includePaths,
5251
inlineComponentData,
53-
browsers: options.browsers,
5452
tailwindConfiguration: options.tailwindConfiguration,
5553
},
5654
cache,

packages/angular_devkit/build_angular/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ export interface StylesheetPluginOptions {
3737
*/
3838
inlineComponentData?: Record<string, string>;
3939

40-
/**
41-
* The browsers to support in browserslist format when processing stylesheets.
42-
* Some postcss plugins such as autoprefixer require the raw browserslist information instead
43-
* of the esbuild formatted target.
44-
*/
45-
browsers: string[];
46-
4740
tailwindConfiguration?: { file: string; package: string };
4841
}
4942

@@ -95,7 +88,7 @@ export class StylesheetPluginFactory {
9588
// Add a load callback to support inline Component styles
9689
build.onLoad(
9790
{ filter: language.componentFilter, namespace: 'angular:styles/component' },
98-
createCachedLoad(cache, async (args) => {
91+
createCachedLoad(cache, (args) => {
9992
const data = options.inlineComponentData?.[args.path];
10093
assert(
10194
typeof data === 'string',

0 commit comments

Comments
 (0)