We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ee31f12 commit 662f31bCopy full SHA for 662f31b
scripts/webpack.client.config.js
@@ -9,6 +9,7 @@ const { GenerateSW } = require("workbox-webpack-plugin");
9
10
const root = path.join(__dirname, "..");
11
const prod = process.env.NODE_ENV === "production" || process.env.CI === "true";
12
+const cachePattern = /\.(?:png|jpg|jpeg|svg|css|js|ttf|woff|eot|woff2|wasm)$/;
13
14
module.exports = (options = {}) => merge(
15
require("./webpack.general.config")(options), {
@@ -67,9 +68,9 @@ module.exports = (options = {}) => merge(
67
68
})
69
].concat(prod ? [
70
new GenerateSW({
- exclude: [/\.html$/],
71
+ include: [cachePattern],
72
runtimeCaching: [{
- urlPattern: new RegExp("^(?!.*\.html)"),
73
+ urlPattern: cachePattern,
74
handler: "StaleWhileRevalidate",
75
options: {
76
cacheName: "code-server",
0 commit comments