mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-17 02:54:21 +08:00
parent
2f7f00f4cd
commit
b65860fee2
@ -246,6 +246,10 @@ export class WebpackCompilerHost implements ts.CompilerHost {
|
||||
return this.readFile(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
trace(message: string) {
|
||||
console.log(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
22
tests/legacy-cli/e2e/tests/misc/trace-resolution.ts
Normal file
22
tests/legacy-cli/e2e/tests/misc/trace-resolution.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import { ng } from '../../utils/process';
|
||||
import { updateJsonFile } from '../../utils/project';
|
||||
|
||||
export default async function () {
|
||||
await updateJsonFile('tsconfig.json', tsconfig => {
|
||||
tsconfig.compilerOptions.traceResolution = true;
|
||||
});
|
||||
|
||||
const { stdout: stdoutTraced } = await ng('build');
|
||||
if (!/Resolving module/.test(stdoutTraced)) {
|
||||
throw new Error(`Modules resolutions must be printed when 'traceResolution' is enabled.`);
|
||||
}
|
||||
|
||||
await updateJsonFile('tsconfig.json', tsconfig => {
|
||||
tsconfig.compilerOptions.traceResolution = false;
|
||||
});
|
||||
|
||||
const { stdout: stdoutUnTraced } = await ng('build');
|
||||
if (/Resolving module/.test(stdoutUnTraced)) {
|
||||
throw new Error(`Modules resolutions must not be printed when 'traceResolution' is disabled.`);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user