Angular2-cli不考虑应用程序文件夹文件和dist文件夹中的其他文件. [英] Angular2-cli not considered app folder files and some other files in dist folder.

查看:115
本文介绍了Angular2-cli不考虑应用程序文件夹文件和dist文件夹中的其他文件.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已使用以下步骤在生产中生成距离

npm install -g angular2-cli
ng new PROJECT_NAME
cd PROJECT_NAME

此后,我复制了其中所有包含应用程序文件夹的代码

ng serve 

它将打开我的项目并成功运行.

ng build --prod 

现在它正在构建所有内容并创建dist文件夹,但不完整.没有应用程序文件夹或必需的文件.

请向我建议生成角度2构建的方法.我想在任何Web服务器上托管此版本.

解决方案

构建的输出

  • dist/main.[hash].bundle.js您的应用程序捆绑了[大小:13 KB,用于新的Angular CLI应用程序为空,〜3 KB 压缩].
  • dist/vendor.[hash].bundle.js捆绑了您的依赖项(@ angular,RxJS ...)[大小:440 KB用于新的Angular CLI应用程序为空, 99 KB 压缩].
  • 您应用程序的
  • dist/index.html入口点.
  • dist/inline.[hash].bundle.js Webpack加载器
  • dist/style.[hash].bundle.css样式定义
  • projectFolder/src/assets 复制的
  • dist/assets资源

引自: 如何捆绑Angular应用进行生产

I have used below steps to generate dist in production

npm install -g angular2-cli
ng new PROJECT_NAME
cd PROJECT_NAME

After this I have copied all the code it included app folder

ng serve 

it will open my project and runs successfully.

ng build --prod 

Now it is building everything and creating dist folder also, but incomplete. There is no app folder or required files.

Please suggest me the method to generate angular 2 build. I want to host this build in any web server.

解决方案

Output of build

  • dist/main.[hash].bundle.js Your application bundled [ size: 13 KB for new Angular CLI application empty, ~3 KB compressed].
  • dist/vendor.[hash].bundle.js Your dependencies (@angular, RxJS...) bundled [ size: 440 KB for new Angular CLI application empty, 99 KB compressed].
  • dist/index.html entry point of your application.
  • dist/inline.[hash].bundle.js webpack loader
  • dist/style.[hash].bundle.css the style definitions
  • dist/assetsresources copied from projectFolder/src/assets

Referred from: How to bundle an Angular app for production

这篇关于Angular2-cli不考虑应用程序文件夹文件和dist文件夹中的其他文件.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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