{"id":13805204,"url":"https://github.com/racido/broccoli-manifest","last_synced_at":"2025-05-13T18:33:20.606Z","repository":{"id":17054612,"uuid":"19819146","full_name":"racido/broccoli-manifest","owner":"racido","description":"HTML5 cache-manifest compilation for broccoli","archived":false,"fork":false,"pushed_at":"2016-12-01T15:19:45.000Z","size":284,"stargazers_count":39,"open_issues_count":2,"forks_count":15,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-20T18:04:40.602Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/racido.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-15T12:53:38.000Z","updated_at":"2017-11-22T22:23:43.000Z","dependencies_parsed_at":"2022-08-04T16:15:49.613Z","dependency_job_id":null,"html_url":"https://github.com/racido/broccoli-manifest","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/racido%2Fbroccoli-manifest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/racido%2Fbroccoli-manifest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/racido%2Fbroccoli-manifest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/racido%2Fbroccoli-manifest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/racido","download_url":"https://codeload.github.com/racido/broccoli-manifest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254003513,"owners_count":21997897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T01:00:58.590Z","updated_at":"2025-05-13T18:33:20.234Z","avatar_url":"https://github.com/racido.png","language":"JavaScript","funding_links":[],"categories":["Packages"],"sub_categories":["Broccoli"],"readme":"broccoli-manifest\n=================\n\nHTML5 cache-manifest compilation for broccoli\n\nA nice introduction on the subject: http://www.html5rocks.com/en/tutorials/appcache/beginner/\n\nThere's also a Wicked-Good-Ember talk on this subject, see http://confreaks.tv/videos/wickedgoodember2015-taking-ember-offline\n\nUsage for Ember Cli\n-------------------\n\n`npm install --save-dev broccoli-manifest`\n`npm install --save broccoli-merge-trees`\n\n```JavaScript\n//app/config/environment.js\n\nENV.manifest = {\n  enabled: true,\n  appcacheFile: \"/manifest.appcache\",\n  excludePaths: ['index.html', 'someother.html'],\n  includePaths: ['/'],\n  network: ['api/'],\n  showCreateDate: true\n}\n````\n\nUpgrade your `index.html` (see below) and you are done.\n\nUsage for Broccoli.js\n---------------------\n\n`npm install --save broccoli-manifest`\n\nUse `broccoli-manifest` as your last filter in the `Brocfile.js` like this\n\n```JavaScript\nvar writeManifest = require('broccoli-manifest');\n\n...\n\nvar completeTree = mergeTrees([appJs, appCss, publicFiles]);\n\nmodule.exports = mergeTrees([completeTree, writeManifest(completeTree)]);\n```\n\nOptions\n-------\n\nYou can pass some options as the second argument to `writeManifest`:\n\n```JavaScript\n\nwriteManifest(completeTree, {\n\tappcacheFile: '/manifest.appcache', // Name of the generated appcache file - default value shown\n\tfallback: ['assets/is-online.json assets/offline.json'] // Lines to add to the FALLBACK section of the generated manifest\n});\n```\n\n`showCreateDate` toggles the inclusion of a Date object or a random string in your manifest. If you\nwant to hide the build date from customers, this is your setting.\n\nThanks to https://github.com/racido/broccoli-manifest/pull/9 files can be filtered using\nregular expressions:\n\n```JavaScript\n{\n  excludePaths: ['index.html', new RegExp(/.\\.map$/)],\n  includePaths: ['']\n}\n```\n\n### External Files\n\n\n```JavaScript\nvar mergeTrees = require('broccoli-merge-trees');\nvar manifest = require('broccoli-manifest');\n\n...\n  all app.import statements go here\n...\n\n// Write a html5 manifest.appcache file with jquery external\nvar completeTree = app.toTree();\nvar manifestTree = manifest(completeTree)\nmanifestTree.includePaths([\"https://code.jquery.com/jquery-2.1.1.min.js\"])\n\nmodule.exports = mergeTrees([completeTree, manifestTree]);\n```\n\n\n\nUpgrade your index.html\n-----------------------\n\nAdd `manifest=\"manifest.appcache\"` to your `\u003chtml\u003e` tag. The extra `\u003cscript\u003e` tag\nadds an eventlistener which automatically refreshes your page after a cache update.\n\nAnother approach is using this gist https://gist.github.com/ef4/82f37eb5dae4e56467b6\nwhich loads all files stated in the manifest file.\n\n```HTML\n\u003c!DOCTYPE html\u003e\n\u003chtml manifest=\"manifest.appcache\"\u003e\n\u003chead\u003e\n  \u003cscript type='text/javascript'\u003ewindow.addEventListener('load',function(e){window.applicationCache.addEventListener('updateready',function(e){if (window.applicationCache.status==window.applicationCache.UPDATEREADY){window.applicationCache.swapCache();window.location.reload();}},false);},false);\u003c/script\u003e\n\n  ...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fracido%2Fbroccoli-manifest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fracido%2Fbroccoli-manifest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fracido%2Fbroccoli-manifest/lists"}