Skip to content

Commit c0802b8

Browse files
mrcranetypescript-bot
authored andcommitted
Cherry-pick PR microsoft#39599 into release-3.9
Component commits: c8d5b98 Load ETW module from a specified path
1 parent 75d6648 commit c0802b8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/compiler/perfLogger.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ namespace ts {
2828
// See https://github.com/microsoft/typescript-etw for more information
2929
let etwModule;
3030
try {
31-
// require() will throw an exception if the module is not installed
31+
const etwModulePath = process.env.TS_ETW_MODULE_PATH ?? "./node_modules/@microsoft/typescript-etw";
32+
33+
// require() will throw an exception if the module is not found
3234
// It may also return undefined if not installed properly
33-
etwModule = require("@microsoft/typescript-etw");
35+
etwModule = require(etwModulePath);
3436
}
3537
catch (e) {
3638
etwModule = undefined;

0 commit comments

Comments
 (0)