Skip to content

Commit

Permalink
feat(@ngtools/webpack): add support for traceResolution
Browse files Browse the repository at this point in the history
Closes #8676
  • Loading branch information
alan-agius4 authored and hansl committed Sep 17, 2018
1 parent 2f7f00f commit b65860f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/ngtools/webpack/src/compiler_host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ export class WebpackCompilerHost implements ts.CompilerHost {
return this.readFile(fileName);
}
}

trace(message: string) {
console.log(message);
}
}


Expand Down
22 changes: 22 additions & 0 deletions tests/legacy-cli/e2e/tests/misc/trace-resolution.ts
Original file line number Diff line number Diff line change
@@ -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.`);
}
}

0 comments on commit b65860f

Please sign in to comment.