Skip to content

Commit a7d4c39

Browse files
committed
TESTING
1 parent e95079c commit a7d4c39

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

packages/angular/build/src/builders/application/execute-build.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export async function executeBuild(
8787
// all TypeScript related contexts.
8888
// TODO: Enable cached bundling for the typescript contexts
8989
const forceTypeScriptRebuild = codeBundleCache?.invalidate(allFileChanges);
90+
console.log('TYPESCRIPT INVALID: ' + forceTypeScriptRebuild);
9091
const typescriptResults: BundleContextResult[] = [];
9192
for (const typescriptContext of bundlerContexts.typescriptContexts) {
9293
typescriptContext.invalidate(allFileChanges);

packages/angular/build/src/tools/esbuild/angular/source-file-cache.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,20 @@ export class SourceFileCache extends Map<string, ts.SourceFile> {
3232

3333
const extraWatchFiles = new Set(this.referencedFiles?.map(path.normalize));
3434

35+
console.log(
36+
'REFERENCED FILES: ' +
37+
JSON.stringify(
38+
[...extraWatchFiles].filter((file) => !file.endsWith('.d.ts')),
39+
null,
40+
2,
41+
),
42+
);
43+
3544
let invalid = false;
3645
for (let file of files) {
3746
file = path.normalize(file);
3847
invalid = this.loadResultCache.invalidate(file) || invalid;
48+
invalid = extraWatchFiles.has(file) || invalid;
3949

4050
// Normalize separators to allow matching TypeScript Host paths
4151
if (USING_WINDOWS) {
@@ -44,8 +54,6 @@ export class SourceFileCache extends Map<string, ts.SourceFile> {
4454

4555
invalid = this.delete(file) || invalid;
4656
this.modifiedFiles.add(file);
47-
48-
invalid = extraWatchFiles.has(file) || invalid;
4957
}
5058

5159
return invalid;

tests/legacy-cli/e2e/tests/basic/rebuild.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@ import { setTimeout } from 'node:timers/promises';
22
import { getGlobalVariable } from '../../utils/env';
33
import { appendToFile, replaceInFile, writeMultipleFiles } from '../../utils/fs';
44
import { silentNg, waitForAnyProcessOutputToMatch } from '../../utils/process';
5-
import { ngServe } from '../../utils/project';
5+
import { ngServe, updateJsonFile } from '../../utils/project';
66

77
export default async function () {
88
const esbuild = getGlobalVariable('argv')['esbuild'];
99
const validBundleRegEx = esbuild ? /sent to client/ : /Compiled successfully\./;
1010
const lazyBundleRegEx = esbuild ? /chunk-/ : /src_app_lazy_lazy_component_ts\.js/;
1111

12+
await updateJsonFile('angular.json', (configJson) => {
13+
const appArchitect = configJson.projects['test-project'].architect;
14+
appArchitect.build.options.verbose = true;
15+
});
16+
1217
// Disable component stylesheet HMR to support page reload based rebuild testing.
1318
// Ideally this environment variable would be passed directly to the new serve process
1419
// but this would require signficant test changes due to the existing `ngServe` signature.

0 commit comments

Comments
 (0)