1.npm run build生成代码加密
2.在iis添加网站定位到dist文件下
第三步第四步配置是www.baidu.com/home一直从新刷新会出现404问题
3.安装URL重写
https://www.iis.net/downloads...
4.在dist文件下配置web.configweb
<system.webServer> <rewrite> <rules> <rule name="Handle History Mode and custom 404/500" stopProcessing="true"> <match url="(.*)" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="/" /> </rule> </rules> </rewrite> </system.webServer>
遇到一个问题:多访问几回页面或者端口应用程序池的状态会结束(事件ID5002,错误503),缘由是后台占用内存太大,解决方法:要勾选预编译并发布版本。npm