minaseem / sw-helper

Service worker tools
MIT License
1 stars 0 forks source link

not working #2

Closed selfagency closed 7 years ago

selfagency commented 7 years ago

here's my function:

function offline(global) {
  const prefetchFiles = [ '.svg', '.eot', '.ttf', '.woff', '.woff2' ]
  const cacheFiles    = [ '.js', '.css', '.svg', '.eot', '.ttf', '.woff', '.woff2' ]
  const strategy      = 'cacheFirst'

  sw({
    cacheName: global.appVer,
    cacheFiles,
    prefetchFiles,
    strategy
  })
}

when i look at the application tab in chrome tools, there's no service worker and there's nothing in the application cache. instead, i see this in my console:

DevTools failed to parse SourceMap: http://localhost:3030/src/scripts/vendor/npm/sw-helper@1.2.0/cacheFirst.js.map

i'm bundling my js with jspm if that makes any difference.

minaseem commented 7 years ago

Not sure about the cause of the issue. Could be jspm, because sw-helper was serving a bundle build with webpack. Please try latest version i.e 1.3.0.

selfagency commented 7 years ago

it's cool, i'm using google's sw library now.