mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
Can't require non console-log when __snapshot generating (#4325)
This commit is contained in:
@ -115,15 +115,17 @@ export function enable(mode: InstrumentationMode = "counters") {
|
||||
}[mode];
|
||||
}
|
||||
|
||||
try {
|
||||
const appConfig = global.require("~/package.json");
|
||||
if (appConfig && appConfig.profiling) {
|
||||
if (!(<any>global).__snapshot) {
|
||||
try {
|
||||
const appConfig = global.require("~/package.json");
|
||||
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() {
|
||||
|
Reference in New Issue
Block a user