filter out .DS_Store and mp3s

pull/7738/head
Richard Harris 7 years ago
parent 56822d227f
commit 890aff4799

@ -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