部署(6.前端项目)
时间:2020-01-23 18:26:01
收藏:0
阅读:108
1.安装node、npm、cnpm
apt install nodejs y apt install npm y node -v npm -v

npm install cnpm -g --registry=HTTPS://registry.npm.taobao.org;
cnpm -v
2.安装依赖
cd demo
cnpm install
3.将路由模式改成history模式:


vim src/router/index.js
4.打包

npm run build
5.配置Nginx
#加入配置 server{ listen 80; server_name 49.234.49.146; location / { root /home/ubuntu/demo/dist; index index.html; } }

原文:https://www.cnblogs.com/xuepangzi/p/12230941.html
评论(0)