filter out .DS_Store and mp3s

pull/2420/head
Richard Harris 6 years ago
parent e3b6040b33
commit 9acd89e912

@ -4,7 +4,12 @@ const ASSETS = `cache${timestamp}`;
// `shell` is an array of all the files generated by Rollup,
// `files` is an array of everything in the `static` directory
const to_cache = shell.concat(files);
const to_cache = shell.concat(files.filter(file => {
const basename = file.split('/').pop();
if (basename[0] === '.') return false; // .DS_Store and friends
if (basename.endsWith('.mp3')) return false; // TODO others?
return true;
}));
const cached = new Set(to_cache);
self.addEventListener('install', event => {

Loading…
Cancel
Save