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