手把手实践教你删除项目当中无用的npm包
在公司中,我们大部分都是多人共同开发和长时间维护一个项目,但是有时候我们会发现有很多已经废弃的npm 包存在 package.json 中,我们想要删除,但是又不能盲目的删除?那么 depcheck 它来了。
如何使用呢
第一步
全局安装:
npm install depcheck -g
第二步
项目更目录下执行 depcheck (这里拿我们自己的项目来做的测试),执行之后,根据自己得到的结果人工删除即可
Unused dependencies
* @xkeshi/vue-qrcode
* any-promise
* backpack-core
* cookie-universal-nuxt
* tls
* to
* vue-loader
* vue-meta-info
Unused devDependencies
* @babel/cli
* @babel/preset-es2015
* @babel/preset-react
* @babel/preset-stage-0
* @babel/register
* @nuxtjs/sentry
* axios-mock-adapter
* babel-eslint
* babel-loader
* babel-plugin-component
* child_process
* css-loader
* element-theme
* element-theme-chalk
* es3-compatible-webpack-plugin
* es3ify-loader
* eslint-friendly-formatter
* eslint-loader
* eslint-plugin-html
* express
* fs
* http-proxy-middleware
* jsencrypt
* lang
* net
* node-sass
* post-loader
* qs
* sass-loader
* vue-style-loader
* webpack-cli
Missing dependencies
* vue-no-ssr: ./.nuxt/components/no-ssr.js
* unfetch: ./.nuxt/client.js
* consola: ./.nuxt/client.js
* nuxt_plugin_route_338f5eda: ./.nuxt/index.js
* nuxt_plugin_main_6a83762f: ./.nuxt/index.js
* nuxt_plugin_http_6a8178fe: ./.nuxt/index.js
* nuxt_plugin_qrcode_7ec40a18: ./.nuxt/index.js
* nuxt_plugin_aliyunosssdkmin_02f21098: ./.nuxt/index.js
* nuxt_plugin_aliyunuploadsdk131min_c379eff6: ./.nuxt/index.js
* vue-router: ./.nuxt/router.js
* node-fetch: ./.nuxt/server.js
* vuex: ./.nuxt/store.js
* ~: ./assets/more-editor/more-editor.js
* resize-observer-polyfill: ./component/util/resizeEvent.js
* co: ./pages/circle/component/dakaEditor/editor.vue
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 零经验选手,Compose 一天开发一款小游戏!
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!