File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ const { GenerateSW } = require("workbox-webpack-plugin");
9
9
10
10
const root = path . join ( __dirname , ".." ) ;
11
11
const prod = process . env . NODE_ENV === "production" || process . env . CI === "true" ;
12
+ const cachePattern = / \. (?: p n g | j p g | j p e g | s v g | c s s | j s | t t f | w o f f | e o t | w o f f 2 | w a s m ) $ / ;
12
13
13
14
module . exports = ( options = { } ) => merge (
14
15
require ( "./webpack.general.config" ) ( options ) , {
@@ -67,9 +68,9 @@ module.exports = (options = {}) => merge(
67
68
} )
68
69
] . concat ( prod ? [
69
70
new GenerateSW ( {
70
- exclude : [ / \. h t m l $ / ] ,
71
+ include : [ cachePattern ] ,
71
72
runtimeCaching : [ {
72
- urlPattern : new RegExp ( "^(?!.*\.html)" ) ,
73
+ urlPattern : cachePattern ,
73
74
handler : "StaleWhileRevalidate" ,
74
75
options : {
75
76
cacheName : "code-server" ,
You can’t perform that action at this time.
0 commit comments