blockbench/scripts/generate_pwa.js
JannisX11 98c3ccbd6e Fix issues with saving files in web app
Fix several web app UI details
2021-03-10 13:05:44 +01:00

21 lines
449 B
JavaScript

const workbox = require('workbox-build');
workbox.generateSW({
cacheId: 'blockbench',
globDirectory: './',
globPatterns: [
'./index.html',
'./favicon.png',
'./js/**/*',
'./lib/**/*',
'./css/**/*',
'./assets/**/*',
'./font/*',
],
swDest: './service_worker.js',
sourcemap: false
}).then(({count, size}) => {
console.log(`Generated service-worker, which will precache ${count} files, totaling ${(size/1e6).toFixed(2)} MB.`);
});