File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/** @type {import('next').NextConfig } */
22const nextConfig = {
3- //导出静态
43 output : "export" ,
4+ reactStrictMode : false ,
55 typescript : {
66 ignoreBuildErrors : true ,
77 } ,
Original file line number Diff line number Diff line change 11// 缓存名称和版本
2- const CACHE_NAME = "folda-scan-cache-v1" ;
2+ const CACHE_NAME =
3+ "folda-scan-cache-v2-" + new Date ( ) . toISOString ( ) . split ( "T" ) [ 0 ] ;
34
45// 需要缓存的资源列表
5- const urlsToCache = [ "/" , "/index.html" , "/manifest.json" ] ;
6+ let urlsToCache = [ "/" , "/index.html" , "/manifest.json" ] ;
67
78// 安装Service Worker
89self . addEventListener ( "install" , ( event ) => {
Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ export async function registerServiceWorker(): Promise<boolean> {
2626 console . log ( "当前浏览器不支持Service Worker" ) ;
2727 return false ;
2828 }
29+ if ( process . env . NODE_ENV === "development" ) {
30+ console . log ( "开发环境下不注册Service Worker" ) ;
31+ return false ;
32+ }
2933
3034 try {
3135 const registration = await navigator . serviceWorker . register ( "/sw.js" ) ;
You can’t perform that action at this time.
0 commit comments