How to find dead code in a large react project?

后端 未结 8 589
执笔经年
执笔经年 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:10

    Libraries such as unrequired and deadcode only support legacy code. In order to find the unused assets, to remove manually, you can use deadfile

    library:https://m-izadmehr.github.io/deadfile/

    • Out of box support for ES5, ES6, React, Vue, ESM, CommonJs.
    • It supports import/require and even dynamic import.

    It can simply find unused files, in any JS project.

    Without any config, it supports ES6, React, JSX, and Vue files:

提交回复
热议问题