GoogleChromeLabs / sw-precache

[Deprecated] A node module to generate service worker code that will precache specific resources so they work offline.
https://developers.google.com/web/tools/workbox/guides/migrations/migrate-from-sw
Apache License 2.0
5.22k stars 388 forks source link

Some files are ignored #352

Closed nazar-pc closed 6 years ago

nazar-pc commented 6 years ago

Here is a simple gulp task:

    .task('bundle-service-worker', function (callback) {
        swPrecache.write('sw.js', {
            staticFileGlobs : [
                "dist/*.min.{css,html,js}",
                "dist/*.{ico,json,png,svg,wasm,woff2}",
                'index.html'
            ]
        }, callback);
    })

For some reason, all files are included except dist/*.min.html, dist/*.wasm and dist/*.woff2.

dist/*.json files are fine and index.html is fine too. It is clearly not the size issue, since all of the files combined are ~600KiB and some of JS files included are bigger than these problematic types of files. Order doesn't seem to have any effect either.

I don't see anything in documentation regarding these file types and can't find such extensions in sw-precache's source code.

nazar-pc commented 6 years ago

Was a race condition