We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vue的项目打包部署在服务器后,访问 http://xxxx.com/xxx 时,提示各种静态资源找不到。
查阅了很多资料,对 webpack 打包做修改:
config/index.js:
build: { assetsPublicPath: '/xxx/', }
build/webpack.prod.js:
output: { publicPath: '/xxx/', }
router/index.js:
const router = new Router({ base: '/xxx/' })
最后,nginx 也需要修改对应的配置
location ^~ /xxx/{ alias /H5/xxx/; try_files $uri $uri/ /xxx/index.html; gzip on; gzip_types application/javascript text/css image/jpeg image/png; }
这样,访问静态资源抱404的问题就解决了。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
vue的项目打包部署在服务器后,访问 http://xxxx.com/xxx 时,提示各种静态资源找不到。
查阅了很多资料,对 webpack 打包做修改:
config/index.js:
build: { assetsPublicPath: '/xxx/', }
build/webpack.prod.js:
output: { publicPath: '/xxx/', }
router/index.js:
最后,nginx 也需要修改对应的配置
这样,访问静态资源抱404的问题就解决了。
The text was updated successfully, but these errors were encountered: