How to find dead code in a large react project?

后端 未结 8 555
执笔经年
执笔经年 2020-12-25 12:47

In order to refactor a client-side project, i\'m looking for a safe way to find (and delete) unused code.

What tools do you use to find unused/dead code in large re

相关标签:
8条回答
  • 2020-12-25 13:15

    findead

    With findead you can find all unused components in your project. Just install and run:

    Install

    npm i -g findead
    

    Usage

    findead /path/to/search
    

    0 讨论(0)
  • 2020-12-25 13:16

    This question recalls me that react by default removes the deadcode from the src when you run the build command.

    Notes: you need to run build command only when you want to ship your app to production.

    0 讨论(0)
提交回复
热议问题