{"library":"offline-plugin","title":"offline-plugin","description":"A webpack plugin that generates a ServiceWorker and optionally AppCache to make webpack projects work offline. Current stable version is 5.0.7 (latest release 2020-08-05). It caches all webpack output assets automatically, with options to customize caching, appShell, navigationPreload, and more. Compared to Workbox, it is simpler to set up but less flexible and has a slower release cadence (last stable release over 4 years ago).","language":"javascript","status":"maintenance","last_verified":"Sat Apr 25","install":{"commands":["npm install offline-plugin"],"cli":null},"imports":["import OfflinePlugin from 'offline-plugin'","const OfflinePlugin = require('offline-plugin')","import * as OfflinePluginRuntime from 'offline-plugin/runtime'","import OfflinePlugin from 'offline-plugin';\nnew OfflinePlugin({ AppCache: true })"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// webpack.config.js\nimport OfflinePlugin from 'offline-plugin';\n\nexport default {\n  plugins: [\n    new OfflinePlugin({\n      appShell: '/index.html',\n      caches: {\n        main: ['app.*.js', 'vendor.*.js', 'styles.*.css'],\n        additional: ['*.png', '*.svg', '*.jpg'],\n        optional: [':rest:']\n      },\n      ServiceWorker: {\n        events: true,\n        navigateFallbackURL: '/'\n      },\n      AppCache: false\n    })\n  ]\n};\n\n// client.js (e.g. entry point)\nimport * as OfflinePluginRuntime from 'offline-plugin/runtime';\nOfflinePluginRuntime.install();","lang":"typescript","description":"Configures OfflinePlugin in webpack and installs the runtime to activate ServiceWorker caching.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}