Angular 2 CLI - How to use /dist folder files created by angular-cli ng build

前端 未结 4 851
野的像风
野的像风 2020-12-24 06:40

I\'m generating dist folder after ng build and my directory looks like

C:\\Source\\angular> ng build

cut and past the dist fold

4条回答
  •  攒了一身酷
    2020-12-24 07:30

    Dist folder is not for ng serve

    It's a build that you can run without ng commands

    ng build :
    

    It creates the build of your project , converts all your ".ts files" and other files to the simple js files that browser can understand.

    So there is no need to run ng serve over the dist folder ,

    just open index.html file inside dist folder and your whole project will run.

提交回复
热议问题