npm - 如何减小 node_modules 文件夹的大小

标签 npm angular

我已经使用 npm 完成了 Angular 2 应用程序,当应用程序只有 1 MB 大小时,node_modules 文件夹消耗大约 90 MB,那么是否有可能减少 node_modules 文件夹大小,至少在 IIS 中发布时?

最佳答案

我建议使用 grunt-package-minifier

最初,我从 node_modules 中删除了所有 package.json、README 等,但将基本的 JavaScript 文件保留在可由 CommonJS 模块加载器使用的结构中。

另请查看 reduce-node-modules-bloat.md

希望对你有帮助

关于npm - 如何减小 node_modules 文件夹的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36861159/

相关文章:

node.js - 使用本地 NPM 包

node.js - ENOTFound 使用 Bower 安装 Gulp-Sass 时出错

javascript - 这个任务队列可以使用哪个库?

angular - 如何将自定义文本添加到 primeng 分页器

c# - Azure AD B2C - IDX20803 : Unable to obtain configuration from: 'System.String' .(.Net 5 Web API + Angular )

javascript - 为什么 openlayers map 在 vue-cli 3 中不起作用

angular - Angular2 中的反射器类是什么?

angular - 在 Angular typescript 中从控制台访问类方法

performance - 如何衡量 Ionic 3 应用程序的性能?

node.js - nodejs 抛出 TypeError : process. uptime is not a function