how to deploy angular2 app built using angular-cli

后端 未结 9 858
误落风尘
误落风尘 2021-01-30 07:05

I have created n new angular app using angular-cli.

I completed the app and preview it using ng-serve, it is working perfectly.

After that I used ng build --

9条回答
  •  庸人自扰
    2021-01-30 07:45

    For anyone looking for an answer for IIS hosting...

    Build your project

    ng build --prod
    

    Copy all contents of the ./dist folder into the root folder of your website maintaining the folder structure within ./dist (ie - don't move anything around). Using the Beta-18 version of the angular-cli all assets (images in my case) were copied to ./dist/assets during the build and were referenced correctly in their containing components.

提交回复
热议问题