mirror of
https://github.com/JannisX11/blockbench.git
synced 2025-04-06 17:31:09 +08:00
22 lines
498 B
JavaScript
22 lines
498 B
JavaScript
import workbox from 'workbox-build';
|
|
|
|
workbox.generateSW({
|
|
cacheId: 'blockbench',
|
|
globDirectory: './',
|
|
globPatterns: [
|
|
'./index.html',
|
|
'./favicon.png',
|
|
'./icon_maskable.png',
|
|
|
|
'./dist/**/*',
|
|
'./css/**/*',
|
|
'./assets/**/*',
|
|
'./font/*',
|
|
],
|
|
swDest: './service_worker.js',
|
|
maximumFileSizeToCacheInBytes: 4_096_000,
|
|
sourcemap: false
|
|
}).then(({count, size}) => {
|
|
console.log(`Generated service-worker, which will precache ${count} files, totaling ${(size/1e6).toFixed(2)} MB.`);
|
|
});
|