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.
Sponsors
Become a sponsor and get your logo on our README on Github with a link to your site.
Become a sponsor
Install
npm install offline-plugin [--save-dev]
Setup
First, instantiate the plugin in your webpack.config
:
// webpack.config.js example var OfflinePlugin = ; moduleexports = // ... plugins: // ... other plugins // it's always better if OfflinePlugin is the last plugin added // ...
(and optionally configure with options)
Then, add the runtime into your entry file (typically main entry):
;
ES6/Babel/TypeScript
;OfflinePluginRuntime;
For more details of usage with
TypeScript
see here
offline-plugin
isn't working?
ℹ️ Troubleshooting | FAQ
Docs
Examples
Articles
- Easy Offline First Apps With Webpack's Offline Plugin
- Handling Client Side App Updates (with Service Workers)
Options
All options are optional and offline-plugin
can be used without specifying them.
See all available options here.
offline-plugin
Who is using
Projects
PWAs
offline-plugin
PWA- Omroep West
- Preact (source)
- CodePan (source)
- Offline Kanban (source)
- Online Board (source)
- Fluid Outliner (source)
If you are using offline-plugin
, feel free to submit a PR to add your project to this list.
offline-plugin
?
Like Support it by giving feedback, contributing, becoming a backer/sponsor or just by 🌟 starring the project!
Backers
Support us with a monthly donation and help us continue our activities. [Become a backer]
Contribution
See CONTRIBUTING