offline-plugin for webpack
This plugin is intended to provide an offline experience for webpack projects. It uses ServiceWorker, and AppCache as a fallback under the hood. Simply include this plugin in your
webpack.config, and the accompanying runtime in your client script, and your project will become offline ready by caching all (or some) of the webpack output assets.
Become a sponsor and get your logo on our README on Github with a link to your site.
Become a sponsor
npm install offline-plugin [--save-dev]
First, instantiate the plugin with options in your
// webpack.config.js examplevar OfflinePlugin = ;moduleexports =// ...plugins:// ... other plugins// it's always better if OfflinePlugin is the last plugin added// ...
Then, add the runtime into your entry file (typically main entry):
For more details of usage with
- Easy Offline First Apps With Webpack's Offline Plugin
- Handling Client Side App Updates (with Service Workers)
All options are optional and
offline-plugin can be used without specifying them.
Who is using
- Offline Kanban (source)
- Preact (source)
- Omroep West (Proof of Concept)
- Online Board (source)
- CodePan (source)
If you are using
offline-plugin, feel free to submit a PR to add your project to this list.
Support us with a monthly donation and help us continue our activities. [Become a backer]