Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
457 views
in Technique[技术] by (71.8m points)

javascript - 每个Angular项目生成大量文件(Huge number of files generated for every Angular project)

I wanted to start a simple hello world app for Angular.(我想为Angular启动一个简单的hello world应用程序。)

When I followed the instructions in the official quickstart the installation created 32,000 files in my project.(当我按照官方快速入门中的说明进行操作时,安装程??序在我的项目中创建了32,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.(我认为这是一个错误,或者我错过了一些东西,所以我决定使用angular-cli ,但是在设置项目后,我计算了41,000个文件。) Where did I go wrong?(我哪里做错了?) Am I missing something really really obvious?(我是否错过了一些确实很明显的东西?)   ask by Moshe Shaham translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

There is nothing wrong with your configuration.(您的配置没有错。)

Angular (since version 2.0) uses npm modules and dependencies for development.(Angular(从2.0版开始)使用npm模块和依赖项进行开发。) That's the sole reason you are seeing such a huge number of files.(这是您看到如此大量文件的唯一原因。) A basic setup of Angular contains transpiler, typings dependencies which are essential for development purposes only.(Angular的基本设置包含编译器,键入依赖项,这些依赖项仅对开发目的至关重要 。) Once you are done with development, all you will need to do is to bundle this application.(开发完成后,您需要做的就是捆绑此应用程序。) After bundling your application, there will be only one bundle.js file which you can then deploy on your server.(捆绑您的应用程序后,将只有一个bundle.js文件,您可以将其部署在服务器上。) 'transpiler' is just a compiler, thanks @omninonsense for adding that.('transpiler' 只是一个编译器,谢谢@omninonsense的添加。)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...