Offline plugin (ServiceWorker, AppCache) for webpack (https://webpack.js.org/)
JavaScript
4,503
673 commits
updated Nov 8, 2021
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 in your webpack.config:
// webpack.config.js example
var OfflinePlugin = require('offline-plugin');
module.exports = {
// ...
plugins: [
// ... other plugins
// it's always better if OfflinePlugin is the last plugin added
new OfflinePlugin()
]
// ...
}
(and optionally configure with options)
Then, add the runtime into your entry file (typically main entry):
require('offline-plugin/runtime').install();
ES6/Babel/TypeScript
import * as OfflinePluginRuntime from 'offline-plugin/runtime';
OfflinePluginRuntime.install();
For more details of usage with
TypeScriptsee here
offline-plugin isn't working?ℹ️ Troubleshooting | FAQ
All options are optional and offline-plugin can be used without specifying them.
offline-pluginoffline-plugin PWAIf you are using offline-plugin, feel free to submit a PR to add your project to this list.
offline-plugin?Support it by giving feedback, contributing, becoming a backer/sponsor or just by 🌟 starring the project!
Support us with a monthly donation and help us continue our activities. [Become a backer]
See CONTRIBUTING
Overall
Maintained
Code review
Latest release
Releases this year
(top 24 of 41)
111,745 followers · starred Apr 2016
1,062 followers · starred Jul 2017
54,181 followers · starred Sep 2015
9,591 followers · starred Sep 2015
Offline plugin (ServiceWorker, AppCache) for webpack (https://webpack.js.org/)
JavaScript
4,503
673 commits
updated Nov 8, 2021
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 in your webpack.config:
// webpack.config.js example
var OfflinePlugin = require('offline-plugin');
module.exports = {
// ...
plugins: [
// ... other plugins
// it's always better if OfflinePlugin is the last plugin added
new OfflinePlugin()
]
// ...
}
(and optionally configure with options)
Then, add the runtime into your entry file (typically main entry):
require('offline-plugin/runtime').install();
ES6/Babel/TypeScript
import * as OfflinePluginRuntime from 'offline-plugin/runtime';
OfflinePluginRuntime.install();
For more details of usage with
TypeScriptsee here
offline-plugin isn't working?ℹ️ Troubleshooting | FAQ
All options are optional and offline-plugin can be used without specifying them.
offline-pluginoffline-plugin PWAIf you are using offline-plugin, feel free to submit a PR to add your project to this list.
offline-plugin?Support it by giving feedback, contributing, becoming a backer/sponsor or just by 🌟 starring the project!
Support us with a monthly donation and help us continue our activities. [Become a backer]
See CONTRIBUTING
Overall
Maintained
Code review
Latest release
Releases this year
(top 24 of 41)
111,745 followers · starred Apr 2016
1,062 followers · starred Jul 2017
54,181 followers · starred Sep 2015
9,591 followers · starred Sep 2015