movsky
movsky

Reputation: 661

Vue + SWPrecacheWebpackPlugin - app.js is not cached

I'm trying to implement a service worker for my website. I used SWPrecacheWebpackPlugin with vue and registering and so on works well. Somehow it doesn't cache all files, in this case I guess the most important app.js file.

When I'm online the file structure built by vue looks like the following:

enter image description here

But when I check the cache the app.js file is missing and in offline mode i just get a white page.

enter image description here

So obivously the service-worker is up and running and is even caching some stuff, but not the relevant app.js file.

My webpack config looks like the following:

new SWPrecacheWebpackPlugin({
      cacheId: 'xxx',
      filename: 'service-worker.js',
      staticFileGlobs: ['dist/**/*.{js,html,css}'],
      minify: true,
      stripPrefix: 'dist/'
    })

I have actually no idea what I am missing.

Update:

The app.js file was too big and wasn't cached by the PlugIn. No warning, no error, nothing...

Upvotes: 0

Views: 270

Answers (0)

Related Questions