how to deploy angular2 app built using angular-cli

后端 未结 9 689
梦谈多话
梦谈多话 2021-01-30 07:12

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:40

    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.

提交回复
热议问题