mirror of
https://github.com/JannisX11/blockbench.git
synced 2024-11-27 04:21:46 +08:00
24 lines
534 B
JavaScript
24 lines
534 B
JavaScript
const workbox = require('workbox-build');
|
|
|
|
workbox.generateSW({
|
|
cacheId: 'blockbench',
|
|
globDirectory: './',
|
|
globPatterns: [
|
|
'./index.html',
|
|
'./favicon.png',
|
|
'./icon_maskable.png',
|
|
|
|
'./js/**/*',
|
|
'./bundle.js',
|
|
'./lib/**/*',
|
|
'./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.`);
|
|
});
|