Showing
2 changed files
with
8 additions
and
2 deletions
@@ -11,8 +11,7 @@ const config = { | @@ -11,8 +11,7 @@ const config = { | ||
11 | // /^https:\/\/(.*)static\.yhbimg\.com/i | 11 | // /^https:\/\/(.*)static\.yhbimg\.com/i |
12 | ], | 12 | ], |
13 | precachePage: [ | 13 | precachePage: [ |
14 | - '/offline.html', | ||
15 | - 'https://cdn.yoho.cn/pwa/404.png' | 14 | + '/offline.html' |
16 | ], | 15 | ], |
17 | precacheStaticFile: [ | 16 | precacheStaticFile: [ |
18 | '/index.css', | 17 | '/index.css', |
@@ -21,6 +20,9 @@ const config = { | @@ -21,6 +20,9 @@ const config = { | ||
21 | '/font/iconfont.woff', | 20 | '/font/iconfont.woff', |
22 | '/common.offline.js', | 21 | '/common.offline.js', |
23 | '/common.offline.css' | 22 | '/common.offline.css' |
23 | + ], | ||
24 | + precacheCdnStaticFile: [ | ||
25 | + 'https://cdn.yoho.cn/pwa/404.png' | ||
24 | ] | 26 | ] |
25 | }; | 27 | }; |
26 | const qs = parseQs(self.location.search.substr(1)); | 28 | const qs = parseQs(self.location.search.substr(1)); |
@@ -52,6 +54,10 @@ const precacheFile = [{ | @@ -52,6 +54,10 @@ const precacheFile = [{ | ||
52 | return { | 54 | return { |
53 | url: page | 55 | url: page |
54 | }; | 56 | }; |
57 | +})).concat(config.precacheCdnStaticFile.map(file => { | ||
58 | + return { | ||
59 | + url: file | ||
60 | + }; | ||
55 | })); | 61 | })); |
56 | 62 | ||
57 | // 预加载文件 | 63 | // 预加载文件 |
This diff could not be displayed because it is too large.
-
Please register or login to post a comment