Angular项目部署到一个IIS服务器上

refs:


https://www.cnblogs.com/kingkangstudy/p/7699710.html
https://blog.angularindepth.com/deploy-an-angular-application-to-iis-60a0897742e7?gi=8dd3c96d6f8

 


1.安装URL rewrite组件:

网址:https://www.microsoft.com/en-us/download/details.aspx?id=47337

2.将angular项目打包生成项目ng build,将生成的dist文件夹下的内容拷贝到网站的目录下

产品级编译

ng build --prod

如果是放在子目录,url需要添加子路径

 

Use the Angular Tour of Heroes as a sample Angular Router application.
Install IIS with the URL Rewrite Module.
Deploy Tour of Heroes to the web root in IIS.
Deploy Tour of Heroes to a specific sub-folder in IIS using the base-href flag.
Use a web.config file to leverage the Angular Router when deploying to a sub-folder in IIS.

 

你可能感兴趣的:(js,vs2017)