为每个 Angular 项目生成的大量文件 [英] Huge number of files generated for every Angular project

查看:37
本文介绍了为每个 Angular 项目生成的大量文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为 Angular 启动一个简单的 hello world 应用程序.

I wanted to start a simple hello world app for Angular.

当我按照官方 quickstart 中的说明操作时,安装创建了 32,000 个文件在我的项目中.

When I followed the instructions in the official quickstart the installation created 32,000 files in my project.

我认为这是一个错误或者我错过了什么,所以我决定使用 angular-cli,但是设置项目后,我统计了 41,000 个文件.

I figured this is some mistake or I missed something, so I decided to use angular-cli, but after setting up the project I counted 41,000 files.

我哪里做错了?我是否遗漏了一些非常明显的东西?

Where did I go wrong? Am I missing something really really obvious?

推荐答案

您的配置没有任何问题.

There is nothing wrong with your configuration.

Angular(从 2.0 版开始)使用 npm 模块和依赖项进行开发.这是您看到如此大量文件的唯一原因.

Angular (since version 2.0) uses npm modules and dependencies for development. That's the sole reason you are seeing such a huge number of files.

Angular 的基本设置包含转译器、类型依赖项,这些依赖项必不可少仅用于开发目的.

A basic setup of Angular contains transpiler, typings dependencies which are essential for development purposes only.

完成开发后,您需要做的就是捆绑此应用程序.

Once you are done with development, all you will need to do is to bundle this application.

捆绑您的应用程序后,将只有一个 bundle.js 文件,您可以将其部署到您的服务器上.

After bundling your application, there will be only one bundle.js file which you can then deploy on your server.

'transpiler' 只是一个编译器,感谢 @omninonsense 添加它.

'transpiler' is just a compiler, thanks @omninonsense for adding that.

这篇关于为每个 Angular 项目生成的大量文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆