Skip to content

Commit 00186fb

Browse files
committed
feat(@angular-devkit/build-angular): add initial experimental esbuild-based application browser builder
An experimental browser application builder (`browser-esbuild`) has been introduced that leverages esbuild as the bundler. This new builder is compatible with options of the current browser application builder (`browser`) and can be enabled for experimentation purposes by replacing the `builder` field of `@angular-devkit/build-angular:browser` from an existing project to `@angular-devkit/build-angular:browser-esbuild`. The builder will generate an ESM-based application and provides support for ES2015+ compatible output with ES2020 as the default. This builder is considered experimental and is not recommended for production applications. Currently not all `browser` builder options and capabilities are supported with this experimental builder. Additional support for these options may be added in the future. The following options and capabilities are not currently supported: * Stylesheet Preprocessors (only CSS styles are supported) * Angular JIT mode (only AOT is supported) * Localization [`localize`] * Watch and dev-server modes [`watch`, `poll`, etc.] * File replacements [`fileReplacements`] * License text extraction [`extractLicenses`] * Bundle budgets [`budgets`] * Global scripts [`scripts`] * Build stats JSON output [`statsJson`] * Deploy URL [`deployURL`] * CommonJS module warnings (no warnings will be generated for CommonJS package usage) * Web Workers * Service workers [`serviceWorker`, `ngswConfigPath`]
1 parent ba92525 commit 00186fb

File tree

9 files changed

+1076
-2
lines changed

9 files changed

+1076
-2
lines changed

packages/angular_devkit/build_angular/builders.json

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
"schema": "./src/builders/browser/schema.json",
1212
"description": "Build a browser application."
1313
},
14+
"browser-esbuild": {
15+
"implementation": "./src/builders/browser-esbuild",
16+
"schema": "./src/builders/browser/schema.json",
17+
"description": "Build a browser application."
18+
},
1419
"dev-server": {
1520
"implementation": "./src/builders/dev-server",
1621
"schema": "./src/builders/dev-server/schema.json",

packages/angular_devkit/build_angular/src/babel/webpack-loader.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ let linkerPluginCreator:
3939
*/
4040
let i18nPluginCreators: I18nPluginCreators | undefined;
4141

42-
async function requiresLinking(path: string, source: string): Promise<boolean> {
42+
export async function requiresLinking(path: string, source: string): Promise<boolean> {
4343
// @angular/core and @angular/compiler will cause false positives
4444
// Also, TypeScript files do not require linking
4545
if (/[\\/]@angular[\\/](?:compiler|core)|\.tsx?$/.test(path)) {

0 commit comments

Comments
 (0)