Hosting Angular 2 app

前端 未结 5 975
心在旅途
心在旅途 2021-02-05 21:21

I\'m new to Angular 2, I know host Angular 1.x on shared hosting like GoDaddy, but I don\'t have idea how publish Angular 2 a

5条回答
  •  广开言路
    2021-02-05 21:32

    You need to build angular2 project using tools like webpack or angular-cli - which also uses webpack post beta.14 release. Webpack will create a distribution directory - dist - which you can deploy to the server. Webpack bundles all the code into a single file which it puts inside the dist folder. Here's a good resource to understand the code and deployment structure of angular2 app: https://github.com/mirkonasato/angular2-course-webpack-starter

    Clone the above directory, run "npm install" to install all dependencies and run "npm run build" you will see the distribution folder - dist - which you can deploy.

提交回复
热议问题