1. npm run build生成打包文件在项目dist目录中

2. 复制dist目录内内容至Tomcat服务器webapps/ROOT文件夹下(无ROOT文件夹则创建)

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

3. 在Tomcat conf文件下编辑web.xml,文件尾部添加:

    ...
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
    </welcome-file-list>
    <error-page>
        <error-code>404</error-code>
        <location>/index.html</location>
    </error-page>
</web-app>

4. 启动Tomcat, 浏览器输入localhost:8080即可访问

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄