Can't require non console-log when __snapshot generating (#4325)

This commit is contained in:
Panayot Cankov
2017-06-06 18:12:53 +03:00
committed by GitHub
parent 51d1be5bb8
commit 853bbd2977

View File

@ -115,6 +115,7 @@ export function enable(mode: InstrumentationMode = "counters") {
}[mode];
}
if (!(<any>global).__snapshot) {
try {
const appConfig = global.require("~/package.json");
if (appConfig && appConfig.profiling) {
@ -125,6 +126,7 @@ try {
} catch(e) {
console.log("Profiling startup failed to figure out defaults from package.json, error: " + e);
}
}
export function disable() {
profileFunctionFactory = undefined;