-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathconfig-overrides.js
More file actions
28 lines (27 loc) · 839 Bytes
/
config-overrides.js
File metadata and controls
28 lines (27 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* config-overrides.js */
const SWPrecacheWebpackPlugin = require("sw-precache-webpack-plugin");
module.exports = function override(config, env) {
if (env === "production") {
config.plugins = [
...config.plugins.filter(
plugin => plugin.constructor.name !== "SWPrecacheWebpackPlugin"
),
new SWPrecacheWebpackPlugin({
dontCacheBustUrlsMatching: /\.\w{8}\./,
filename: "service-worker.js",
logger(message) {
if (message.indexOf("Total precache size is") === 0) {
return;
}
if (message.indexOf("Skipping static resource") === 0) {
return;
}
console.log(message);
},
minify: true,
staticFileGlobsIgnorePatterns: [/\.map$/, /asset-manifest\.json$/]
})
];
}
return config;
};