A tool that gives suggestions about which React components can be lazy loaded.
Clone the repo (along with submodules)
git clone https://github.com/naveensaigit/component-analyzer --recurse-submodules
Install the dependencies for all the submodules
cd component-analyzer
chmod +x install.sh
./install.sh
Install component-analyzer
as a dependency in your React repo
cd /path/to/repo
yarn link "component-analyzer"
Add the following command to your package.json
in the scripts
section
"analyze": "component-analyzer"
Add the following line of code to your index.html
file in the beginning of the head
section.
<script src="http://localhost:8097"></script>
Execute npm run analyze
to get the renderTree file.