• 【前端开发】删除项目中没使用冗余的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
  • 相关阅读:
    Android应用程序注冊广播接收器(registerReceiver)的过程分析
    智能生活 “视”不可挡——首届TCL杯HTML5智能电视开发大赛等你来挑战
    点滴的积累---J2SE学习小结
    公开课
    iOS学习之 plist文件的读写
    【STL】关联容器 — hash_set
    《Pro Android Graphics》读书笔记之第三节
    第一章. ActionScript 语言基础
    JAVA数组的定义及用法
    MS-SQLSERVER中的MSDTC不可用解决方法
  • 原文地址:https://www.cnblogs.com/xiaohuizhang/p/16442229.html
Copyright © 2020-2023  润新知