Skip to content

Commit

Permalink
Cherry-pick PR #39599 into release-3.9 (#39601)
Browse files Browse the repository at this point in the history
Component commits:
c8d5b98 Load ETW module from a specified path

Co-authored-by: Michael Crane <micran@microsoft.com>
  • Loading branch information
typescript-bot and mrcrane committed Jul 14, 2020
1 parent 75d6648 commit 761a9ed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/compiler/perfLogger.ts
Expand Up @@ -28,9 +28,11 @@ namespace ts {
// See https://github.com/microsoft/typescript-etw for more information
let etwModule;
try {
// require() will throw an exception if the module is not installed
const etwModulePath = process.env.TS_ETW_MODULE_PATH ?? "./node_modules/@microsoft/typescript-etw";

// require() will throw an exception if the module is not found
// It may also return undefined if not installed properly
etwModule = require("@microsoft/typescript-etw");
etwModule = require(etwModulePath);
}
catch (e) {
etwModule = undefined;
Expand Down

0 comments on commit 761a9ed

Please sign in to comment.