Skip to content

Commit 7172df1

Browse files
committed
refactor(@angular/build): allow forcing bundler context rebundle
A bundle call for a `BundlerContext` can now force a rebundling in cases where the cached version should not be used. This is currently not leveraged within the code but will be used for improvements to typescript based context rebuilds in the future.
1 parent c242d29 commit 7172df1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/angular/build/src/tools/esbuild/bundler-context.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,13 @@ export class BundlerContext {
185185
* All builds use the `write` option with a value of `false` to allow for the output files
186186
* build result array to be populated.
187187
*
188+
* @param force If true, always rebundle.
188189
* @returns If output files are generated, the full esbuild BuildResult; if not, the
189190
* warnings and errors for the attempted build.
190191
*/
191-
async bundle(): Promise<BundleContextResult> {
192+
async bundle(force?: boolean): Promise<BundleContextResult> {
192193
// Return existing result if present
193-
if (this.#esbuildResult) {
194+
if (!force && this.#esbuildResult) {
194195
return this.#esbuildResult;
195196
}
196197

0 commit comments

Comments
 (0)