laravel - Vue CLI 3 和 Laravel 之间的 PWA 配置中的 URL 错误
问题描述
我有一个将 vue cli(使用 vue 2)和 laravel 7 与 vue.config.js 结合起来的项目,如下所示
module.exports = {
devServer: {
open: true,
overlay: true,
proxy: 'https://myapp.test'
},
outputDir: '../public/assets/app',
publicPath: process.env.NODE_ENV === 'production'
? '/assets/app/'
: '/',
// modify the location of the generated HTML file.
// make sure to do this only in production.
indexPath: process.env.NODE_ENV === 'production'
? '../../../resources/views/app.blade.php'
: 'index.html'
}
构建工作正常,但加载页面时出现此错误
Uncaught (in promise) bad-precaching-response: bad-precaching-response :: [{"url":"https://myapp.test/assets/app/index.html?__WB_REVISION__=bd0b9edc434ef6ad9c55783d10fbbffe","status":404}]
我已经浏览了 PWA 的文档,但我找不到可以自定义/指示正确 url 的位置,因为我在该路径中没有 index.html。
解决方案
推荐阅读
- r - R包“RQGIS3”找不到proj.db
- php - 使用 Fat Free Framework 打印换行符(换行符)
- angular - NgRx - 状态改变不当
- python - 希望解决 1970 错误的 Pandas 中的日期错误
- r - 在另一个data.frame(data.table)中查找一个data.frame的对应日期
- vba - 没有附件时在特定邮件上显示回形针图标
- java - 运行 mvn 命令时如何忽略 jvm.config?
- python - 为什么这个程序没有结束?如果我不输入正确的数字,游戏将永远进行
- android-studio - 为什么自定义字体在启动应用程序时仅在几毫秒后出现?渲染问题?- 安卓工作室
- javascript - 角 | NgRx 在将对象放入下拉列表之前检查对象中的空字段