TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Why this bloat in Angular?

8 点作者 avighnay超过 6 年前
Why does each raw skeletal app generated by Angular need 240Mb of disk space and contains around 32 thousand files 239Mb in the node_modules folder.<p>If Angular is already global, why does it need all these files? And what are they doing?<p>Disclaimer: I am an old timer and really miss the just &#x27;download and unzip&#x27; days of javascript and open source

7 条评论

quantummkv超过 6 年前
It mostly boils down to the fact that javascript&#x2F;nodejs does not ship with a standard library like every other language does. So every project has to include its own copy of what passes as the standard library (A random smattering of npm modules).<p>A casual peek into your node_modules folder will reveal packages such as left-pad, is-number, is-array etc. Stuff that is pre packaged into the runtime of any sane language. That&#x27;s what makes up most of the bulk in any nodejs project.
superasn超过 6 年前
It&#x27;s just how it is. You would find this article particularly insightful (1). An excerpt from it:<p>&gt; It’s true. Each installation of Babel includes a picture of Guy Fieri, and there is nothing you can do about it.<p>(1) <a href="https:&#x2F;&#x2F;medium.com&#x2F;@jdan&#x2F;i-peeked-into-my-node-modules-directory-and-you-wont-believe-what-happened-next-b89f63d21558" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;@jdan&#x2F;i-peeked-into-my-node-modules-direc...</a>
评论 #17876470 未加载
romanovcode超过 6 年前
It&#x27;s not related to Angular, it&#x27;s just how modern frontend works now. Also when you build it with production it won&#x27;t be 240mb. Remember that it loads all dependencies as well as many build dependencies.<p>In fact Angular team is working on new view engine (ngIvy) that shown to tree-shaken &quot;Hello World&quot; angular application down to 2.6kb.<p>IMO your reasoning for complaining is ridiculous, it&#x27;s like saying &quot;I hate C#, why do I need to download 6gb Visual Studio that has 64 thousand files in &quot;Program Files&#x2F;Visual Studio&quot; folder to build C# application!&quot;.
avighnay超过 6 年前
Found this article on setting up Angular with minimal dependencies<p><a href="https:&#x2F;&#x2F;blog.angularindepth.com&#x2F;setting-up-angular-from-scratch-1f518c65d8ab" rel="nofollow">https:&#x2F;&#x2F;blog.angularindepth.com&#x2F;setting-up-angular-from-scra...</a><p>[edit] this does not work well with Angular 6 and also it reduces dependencies only to 100Mb
avighnay超过 6 年前
This article echoes what I felt and here it is compared against Angular 1 itself<p><a href="https:&#x2F;&#x2F;medium.com&#x2F;dirtyjs&#x2F;why-angular-2-4-5-6-sucks-afb36567ad68" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;dirtyjs&#x2F;why-angular-2-4-5-6-sucks-afb3656...</a>
评论 #17884178 未加载
fiiv超过 6 年前
You&#x27;re likely seeing a lot of the build tooling. Things to convert (from Typescript&#x2F;etc to plain JS), bundle (optimised files for prod) and run the dev environment (static file serving, possibly from memory and not disk, not sure off the top of my head).
评论 #17875683 未加载
muzani超过 6 年前
Because it appeals to the demographic who uses it. Power at the cost of size and weight.<p>If you care a lot about size, you could use something like Vue.