接上回创建完成项目,这次是部署一下
history模式
这个模式就很简单,直接上代码,就是要定位到文件所在位置吗
路由配置
vite.config.ts配置
然后就是打包,我的是放在了html下了
location /dist {
root html/;
index index.html;
try_files $uri $uri/ /dist/index.html;
}
这样就可以访问了
hash模式
其实只需要把路由配置那改为hash模式,再把vite.config.ts的base改为“./”