4

排查 vue 项目中没有依赖的文件

 2 years ago
source link: https://www.v2ex.com/t/810649
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

V2EX  ›  Vue.js

排查 vue 项目中没有依赖的文件

  zhangLLL · 17 分钟前 · 38 次点击
我们的前端项目是使用 vue-cli 脚手架搭建的项目,随着版本的迭代,代码量、文件数越来越多。有的功能加了又删,项目中出现了好多无用的 js 或者 vue 文件,迭代新需求时十分影响使用关键字搜索的结果。
现在要找出所有无用的文件,目前想到的做法是从入口入手,比如 main.js 或者 router.js ,根据关键字,比如 import 、require 找到依赖的其他的文件,再一路找下去,剩下的文件就是无用的了。
想问问大家有没有插件实现了类似的功能,还有上述的做法是不是还有遗漏的可能?

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK