Angular2-cli not considered app folder files and some other files in dist folder.

给你一囗甜甜゛ 提交于 2020-01-06 18:03:57

问题


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.


回答1:


app folder only for development, when build process complete you got all files you need to deploy on a sever, not app, not src.




回答2:


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



来源:https://stackoverflow.com/questions/41972749/angular2-cli-not-considered-app-folder-files-and-some-other-files-in-dist-folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!