vite 打包后的项目部署后,页面不能刷新的问题?
部署后页面进入没有问题,但是一刷新就出现空白页面
以下是我nginx的配置
server {
listen 80;
gzip on;
gzip_static on;
location / {
try_files $uri $uri/ /;
root /usr/share/nginx/admin;
index index.html;
}
}
打包配置
build: {
rollupOptions: {
// 静态资源分类打包
output: {
chunkFileNames: 'static/js/[name]-[hash].js',
entryFileNames: 'static/js/[name]-[hash].js',
assetFileNames: 'static/[ext]/[name]-[hash].[ext]',
}
},
sourcemap: false,
target: 'es2015',
reportCompressedSize: true
}
ng 的配置写错了。