Skip to content

Commit

Permalink
refactor(@angular/build): maintain previous compiler plugin factory s…
Browse files Browse the repository at this point in the history
…ignature

To minimize downstream breakage for consumers of the private API, the
`createCompilerPlugin` function signature has been adjusted to maintain
compatibility with v18.
  • Loading branch information
clydin committed Nov 25, 2024
1 parent 173dc0e commit 5320e87
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion packages/angular/build/src/private.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
* their existence may change in any future version.
*/

import {
CompilerPluginOptions,
createCompilerPlugin as internalCreateCompilerPlugin,
} from './tools/esbuild/angular/compiler-plugin';
import { ComponentStylesheetBundler } from './tools/esbuild/angular/component-stylesheets';
import { BundleStylesheetOptions } from './tools/esbuild/stylesheets/bundle-options';

// Builders
export { buildApplicationInternal } from './builders/application';
export type { ApplicationBuilderInternalOptions } from './builders/application/options';
Expand All @@ -29,7 +36,20 @@ export { SassWorkerImplementation } from './tools/sass/sass-service';
export { SourceFileCache } from './tools/esbuild/angular/source-file-cache';
export { createJitResourceTransformer } from './tools/angular/transformers/jit-resource-transformer';
export { JavaScriptTransformer } from './tools/esbuild/javascript-transformer';
export { createCompilerPlugin } from './tools/esbuild/angular/compiler-plugin';

export function createCompilerPlugin(
pluginOptions: CompilerPluginOptions,
styleOptions: BundleStylesheetOptions & { inlineStyleLanguage: string },
): import('esbuild').Plugin {
return internalCreateCompilerPlugin(
pluginOptions,
new ComponentStylesheetBundler(
styleOptions,
styleOptions.inlineStyleLanguage,
pluginOptions.incremental,
),
);
}

// Utilities
export * from './utils/bundle-calculator';
Expand Down

0 comments on commit 5320e87

Please sign in to comment.