Hosting Angular 2 app

前端 未结 5 976
心在旅途
心在旅途 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:25

    As a component based language, angular 2 includes some caveats in it's deployment process. First, the files used in development environment aren't necessarily shipped to production. In short, you'll only need to upload .js, .html and .css files .

    Second is that even if your application works deploying only the files mention above, it's advisable to include the following process:

    Bundling: Compiling all the .js files into single files. For instance, vendor.js could include all third party libs and bundle.js would include all application .js files. (Bundles are import for performance reasons, but bear in mind that with the arrival of http 2, this process will be abandoned)

    Minification: it's a standard process in all web apps, but now you only minify bundled files.

    Take a look in this article, as it give some examples of tools that can help you with deployment process. http://www.ninjaducks.in/hacking/angular-setup/

提交回复
热议问题