1.进入到项目根目录执行
npm run build
此时会自动打包在dist目录下,但是这个还不能用。
第一步:
config/index.js
const router = new Router({
base: BASE_URL,
routes: routes,
mode: 'history' //mode是history模式的时候,需要服务器支持的,文档里面已经说明了
})
修改nginx
location / {
try_files $uri $uri/ /index.html;
}