准备
准备好项目,这里拿上一遍文章的demo来打包部署。服务器为Nginx
当然也可用Tomcat》》dist文件放webapps下启动访问到localhost:8080/dist/index.html
上一篇文章地址:https://www.jianshu.com/p/a400950a50fd
编译打包
使用命令:
npm run build
然后可看到项目目录下有一个dist的文件夹,这里就是打包内容。
image.png
部署到Nginx
下载好nginx的Windows版我这里用最新稳定版:nginx-1.14.2
把dist文件夹放到nginx里的html文件夹下,然后修改conf/nginx.conf配置:
监听端口改为8088,然后把根目录root html改为root html/dist
dist.png
conf.png
启动Nginx
windows启动命令
start nginx
image.png
浏览器访问
访问:http://localhost:8088/#/
GIF.gif









网友评论