2022-06-21 13:57:34 +00:00
|
|
|
|
const { merge } = require("webpack-merge");
|
2024-05-16 12:33:28 +00:00
|
|
|
|
const WorkboxPlugin = require("workbox-webpack-plugin");
|
2020-06-08 09:00:58 +00:00
|
|
|
|
const common = require("./craco.common.config.js");
|
2023-01-06 13:42:03 +00:00
|
|
|
|
|
2020-06-08 09:00:58 +00:00
|
|
|
|
module.exports = merge(common, {
|
2023-05-23 09:24:41 +00:00
|
|
|
|
devServer: {
|
|
|
|
|
|
client: {
|
|
|
|
|
|
overlay: {
|
|
|
|
|
|
warnings: false,
|
2024-03-04 07:52:06 +00:00
|
|
|
|
errors: false,
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
2023-05-23 09:24:41 +00:00
|
|
|
|
},
|
2022-04-18 08:21:36 +00:00
|
|
|
|
optimization: {
|
|
|
|
|
|
minimize: false,
|
|
|
|
|
|
},
|
2024-03-04 07:52:06 +00:00
|
|
|
|
cache: {
|
|
|
|
|
|
type: "filesystem",
|
|
|
|
|
|
memoryCacheUnaffected: true,
|
|
|
|
|
|
},
|
|
|
|
|
|
experiments: {
|
|
|
|
|
|
cacheUnaffected: true,
|
|
|
|
|
|
},
|
2024-05-16 12:33:28 +00:00
|
|
|
|
webpack: {
|
|
|
|
|
|
plugins: [
|
|
|
|
|
|
new WorkboxPlugin.InjectManifest({
|
2024-06-14 11:00:23 +00:00
|
|
|
|
swSrc: "./src/serviceWorker.ts",
|
2024-05-16 12:33:28 +00:00
|
|
|
|
mode: "development",
|
|
|
|
|
|
swDest: "./pageService.js",
|
|
|
|
|
|
exclude: [
|
|
|
|
|
|
// Don’t cache source maps and PWA manifests.
|
|
|
|
|
|
// (These are the default values of the `exclude` option: https://developer.chrome.com/docs/workbox/reference/workbox-build/#type-WebpackPartial,
|
|
|
|
|
|
// so we need to specify them explicitly if we’re extending this array.)
|
|
|
|
|
|
/\.map$/,
|
|
|
|
|
|
/^manifest.*\.js$/,
|
|
|
|
|
|
// Don’t cache the root html file
|
|
|
|
|
|
/index\.html/,
|
|
|
|
|
|
// Don’t cache LICENSE.txt files emitted by CRA
|
|
|
|
|
|
// when a chunk includes some license comments
|
|
|
|
|
|
/LICENSE\.txt/,
|
|
|
|
|
|
// Don’t cache static icons as there are hundreds of them, and caching them all
|
|
|
|
|
|
// one by one (as the service worker does it) keeps the network busy for a long time
|
|
|
|
|
|
// and delays the service worker installation
|
|
|
|
|
|
/\/*\.svg$/,
|
|
|
|
|
|
/\.(js|css|html|png|jpg|jpeg|gif)$/, // Exclude JS, CSS, HTML, and image files
|
|
|
|
|
|
],
|
|
|
|
|
|
}),
|
|
|
|
|
|
],
|
|
|
|
|
|
},
|
2020-06-08 09:00:58 +00:00
|
|
|
|
});
|