Skip to content

Commit

Permalink
feat(@angular-devkit/build-angular): add initial experimental esbuild…
Browse files Browse the repository at this point in the history
…-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`]
  • Loading branch information
clydin committed Apr 23, 2022
1 parent ba92525 commit 00186fb
Show file tree
Hide file tree
Showing 9 changed files with 1,076 additions and 2 deletions.
5 changes: 5 additions & 0 deletions packages/angular_devkit/build_angular/builders.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
"schema": "./src/builders/browser/schema.json",
"description": "Build a browser application."
},
"browser-esbuild": {
"implementation": "./src/builders/browser-esbuild",
"schema": "./src/builders/browser/schema.json",
"description": "Build a browser application."
},
"dev-server": {
"implementation": "./src/builders/dev-server",
"schema": "./src/builders/dev-server/schema.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ let linkerPluginCreator:
*/
let i18nPluginCreators: I18nPluginCreators | undefined;

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

0 comments on commit 00186fb

Please sign in to comment.