Skip to content

Commit 9ea3e8e

Browse files
clydindgp1130
authored andcommitted
perf(@angular-devkit/build-angular): only import esbuild watcher when in watch mode
When using the esbuild-based browser application builder, all the watch-related code is now only imported when the watch mode is enabled. This removes the need for Node.js to resolve and load code that will not be used. (cherry picked from commit 8daf3a5)
1 parent c60d16a commit 9ea3e8e

File tree

1 file changed

+2
-1
lines changed
  • packages/angular_devkit/build_angular/src/builders/browser-esbuild

1 file changed

+2
-1
lines changed

packages/angular_devkit/build_angular/src/builders/browser-esbuild/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import { NormalizedBrowserOptions, normalizeOptions } from './options';
3232
import { shutdownSassWorkerPool } from './sass-plugin';
3333
import { Schema as BrowserBuilderOptions } from './schema';
3434
import { createStylesheetBundleOptions } from './stylesheets';
35-
import { ChangedFiles, createWatcher } from './watcher';
35+
import type { ChangedFiles } from './watcher';
3636

3737
interface RebuildState {
3838
codeRebuild?: BundlerContext;
@@ -673,6 +673,7 @@ export async function* buildEsbuildBrowser(
673673
}
674674

675675
// Setup a watcher
676+
const { createWatcher } = await import('./watcher');
676677
const watcher = createWatcher({
677678
polling: typeof userOptions.poll === 'number',
678679
interval: userOptions.poll,

0 commit comments

Comments
 (0)