Skip to content

Commit 9ad8514

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. (cherry picked from commit 7172df1)
1 parent 0d4558e commit 9ad8514

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

Lines changed: 3 additions & 2 deletions
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)