mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
Setting alias for ~/ in webpack enables us to use require('~/package.json') (#4468)
This commit is contained in:
@ -117,16 +117,16 @@ export function enable(mode: InstrumentationMode = "counters") {
|
|||||||
}[mode];
|
}[mode];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(<any>global).__snapshot) {
|
try {
|
||||||
try {
|
const appConfig = require("~/package.json");
|
||||||
const appConfig = global.require("~/package.json");
|
|
||||||
if (appConfig && appConfig.profiling) {
|
|
||||||
if (appConfig && appConfig.profiling) {
|
if (appConfig && appConfig.profiling) {
|
||||||
enable(appConfig.profiling);
|
enable(appConfig.profiling);
|
||||||
}
|
}
|
||||||
}
|
} catch(e1) {
|
||||||
} catch(e) {
|
try {
|
||||||
console.log("Profiling startup failed to figure out defaults from package.json, error: " + e);
|
console.log("Profiling startup failed to figure out defaults from package.json, error: " + e1);
|
||||||
|
} catch(e2) {
|
||||||
|
// We can get here if an exception is thrown in the mksnapshot as there is no console there.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user