Search code examples
javascriptwebpacksw-precache

sw-precache offline mode not fetching js or css


Im using the sw-precache-webpack-plugin for my React progressive app, on offline mode I get the Template from cacheStorage, but its not fetching the css or js. Not sure where im going wrong.

enter image description here

enter image description here

new SWPrecacheWebpackPlugin({
      cacheId: 'example-app',
      filename: 'sw.js',
      // minify: true,
      runtimeCaching: [{
        urlPattern: '/',
        handler: 'cacheFirst',
      }],
      dynamicUrlToDependencies: {
        '/': ['./server/views/index.ejs'],
      },
    }),

Solution

  • I fixed the issue by adding below, this ignored the url parameters.

      ignoreUrlParametersMatching: [/./],