在开发模式(非生产模式)下,安装并运行 Service Worker 会影响 HMR(热模块重新加载)。但是,可以将浏览器配置为绕过网络,而不是使用 Service Worker 的缓存。
¥When in develop mode (not production), having a Service Worker installed and running will mess with the HMR (Hot Module Reload). However, the browser can be configured to bypass for network instead of using the Service Worker’s cache.
当你的开发活动不包含配置 Service Worker(例如编辑 “/src-pwa/register-service-worker.js” 文件时)时,你可以安全地触发 $ quasar dev -m spa
(而不是 $ quasar dev -m pwa
)命令,以避免额外关注 Service Worker 的影响 - 有时它可能会造成干扰。
¥When your development activity does not include configuring the Service Worker (like when editing the “/src-pwa/register-service-worker.js” file), then you can safely trigger the $ quasar dev -m spa
(instead of $ quasar dev -m pwa
) command to avoid the extra hassle of paying attention to the effects of the Service Worker – which sometimes may get in the way.
警告
默认情况下,开发服务器使用最低限度的 Service Worker 预缓存公共文件夹。将无法离线工作。
¥The development server by default uses a bare minimum Service Worker precaching only the public folder. Working offline will not be available.