With grunt-sw-precache, I am trying to cache my application:
'develop': {
// staticFileGlobs: [
// 'app/styles/**/*.css',
// 'font/**/*.{woff,ttf,svg,eot}',
// 'app/images/**/*.{gif,png,jpg}',
// 'app/scripts/**/*.js',
// ],
staticFileGlobs: ['index.html','/app/**/*.{js,html,css,png,jpg,gif}'],
stripPrefix: 'app',
baseDir:'./',
runtimeCaching: [{
handler: 'networkFirst'
}]
},
},
I always get:
Total precache size is about 0 B for 0 resources.
My directory structure looks like this:
projectRoot
______app
__________images
__________styles
__________controllers
__________jsFilesHere
___________app.js
_____________config.js
_____________index.html
_____________sw.js
I need to cache all my files to enable the application to run offline as well. For that matter I need to cache my entire app folder
How do I change this
staticFileGlobs: ['index.html','/app/**/*.{js,html,css,png,jpg,gif}'],
to be able to get this working?
I tried replacing it with:
staticFileGlobs: ['.'] as well. but yet I get the same message.
As suggested, I am now storing sw.js in app folder only and have removed /
'develop': {
navigateFallback: '/index.html',
staticFileGlobs: ['scripts/**/*.js'],
stripPrefix: 'app',
baseDir:'./app',
runtimeCaching: [{
handler: 'networkFirst'
}]
},
But still nothing changed