Skip to content

Instantly share code, notes, and snippets.

@fnakstad
Created July 18, 2013 21:51
Show Gist options
  • Select an option

  • Save fnakstad/6033441 to your computer and use it in GitHub Desktop.

Select an option

Save fnakstad/6033441 to your computer and use it in GitHub Desktop.
module.exports = function(grunt) {
// Load plugins
grunt.loadNpmTasks('grunt-manifest');
grunt.loadNpmTasks('grunt-contrib-watch');
// Make a list of paths/files to cache
var cache = ['./public/js/*', './public/img/*', './public/css/*'];
grunt.initConfig({
// Define how your manifest file should be constructed
manifest: {
generate: {
options: {
network: ['http://*', 'https://*'],
timestamp: true
},
src: cache,
dest: 'manifest.appcache'
}
},
// Now setup the watch task to monitor the same files
// that are referenced in the CACHE section of your
// manifest, and fire the "manifest" task whenever
// a change is detected
watch: {
scripts: {
files: cache,
tasks: ['manifest']
}
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment