mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-09 16:39:46 -05:00
Load ETW module from a specified path (#39599)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user