Registry / devops / grunt-manifest

grunt-manifest

JSON →
library0.4.4jsnpmunverified

Grunt plugin to generate HTML5 Cache Manifest (appcache) files for offline web applications. Latest version 0.4.4 (last released in 2015) works with Grunt ~0.4.5 and Node >= 0.10.0. Provides configuration options for cache, network, fallback sections, base path, file exclusion, and hash/timestamp-based versioning. Deprecated as the AppCache standard has been removed from modern browsers in favor of Service Workers.

npm install grunt-manifest
INSTALL
IMPORT
SIG · GRUNT-MANIFEST
G
grunt-manifest
devopsjavascriptv0.4.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

grunt-task
grunt.loadNpmTasks('grunt-manifest');
require('grunt-manifest');
This is a Grunt plugin, not a regular module. It must be loaded via grunt.loadNpmTasks in your Gruntfile.

Configure and run grunt-manifest to generate an appcache manifest file from a set of source files.

// Gruntfile.js module.exports = function(grunt) { grunt.initConfig({ manifest: { generate: { options: { basePath: 'app/', cache: ['index.html'], network: ['*'], fallback: ['/ /offline.html'], exclude: ['js/ignore.js'], preferOnline: true, verbose: true, timestamp: true, hash: false, headcomment: 'v1.0.0' }, src: ['**/*.html', 'css/*.css', 'js/*.js', 'img/*.{png,jpg}'], dest: 'manifest.appcache' } } }); grunt.loadNpmTasks('grunt-manifest'); grunt.registerTask('default', ['manifest']); };
Debug
Known issues
deprecatedThe HTML5 Application Cache (AppCache) standard is deprecated and removed from modern browsers (Chrome 90+, Firefox 86+, Safari 13.1+). Use Service Workers instead.
fix
Migrate to a Service Worker library like 'workbox-webpack-plugin' or 'serviceworker-webpack-plugin'.
affects: all
gotchaUsing timestamp causes the manifest to change on every build, even if file contents didn't change, invalidating the cache unnecessarily.
fix
Set timestamp to false and use hash: true for content-based versioning.
affects: >=0.4.0
gotchaMissing basePath option leads to incorrect relative paths in the manifest, causing assets not to be cached properly.
fix
Always set basePath to the root directory relative to the server serving the manifest.
affects: all
deprecatedVersion 0.4.4 uses Grunt ~0.4.5 which is deprecated. Upgrade to Grunt 1.x may cause incompatibilities.
fix
Use grunt-contrib-manifest or switch to a modern build tool with Service Worker support.
affects: >=0.4.0
Errors
Common errors & fixes
Warning: Task "manifest" not found. Use --force to continue.
grunt-manifest is not loaded in Gruntfile
fix
Add `grunt.loadNpmTasks('grunt-manifest');` after initConfig.
Fatal error: Cannot find module 'grunt-manifest'
Package not installed or not in node_modules
fix
Run `npm install grunt-manifest --save-dev` and ensure node_modules contains it.
Running "manifest" task ... Fatal error: Path must be a string. Received undefined
No src files specified or basePath not set
fix
Set 'src' option to a glob pattern or array of files, and optionally 'basePath'.
Upgrade
Version history
0.4.4latest on npm
Audit
Dependencies
gruntrequiredPlugin requires Grunt ~0.4.5 to be installed
Agent activity
6 hits · last 30 days
node
6
Resources
grunt-manifest — npm install grunt-manifest · libregistry