From 370b24af9366bae17152f522007ccfe5fe3df241 Mon Sep 17 00:00:00 2001 From: Lucas Fronza Date: Thu, 27 Feb 2020 16:13:06 +0000 Subject: [PATCH] Tiny improvement to loaded modules code example --- docs/performance.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/performance.md b/docs/performance.md index f1a2c98acd1..5800bdbd0f5 100644 --- a/docs/performance.md +++ b/docs/performance.md @@ -375,7 +375,7 @@ console.log( ); // grab this text blob, and put it in a file named packager/modulePaths.js -console.log(`module.exports = ${JSON.stringify(loadedModuleNames.sort())};`); +console.log(`module.exports = ${JSON.stringify(loadedModuleNames.sort(), null, 2)};`); ``` When you run your app, you can look in the console and see how many modules have been loaded, and how many are waiting. You may want to read the moduleNames and see if there are any surprises. Note that inline requires are invoked the first time the imports are referenced. You may need to investigate and refactor to ensure only the modules you want are loaded on startup. Note that you can change the Systrace object on require to help debug problematic requires.