Skip to content

Commit

Permalink
Load ETW module from a specified path
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcrane committed Jun 15, 2020
1 parent f7bca49 commit c8d5b98
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/compiler/perfLogger.ts
Original file line number Diff line number Diff line change
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 c8d5b98

Please sign in to comment.