NekR/offline-plugin


Offline plugin (ServiceWorker, AppCache) for webpack (https://webpack.js.org/)

License: MIT

Language: JavaScript

Keywords: appcache, application-cache, caching, javascript, offline, offline-first, plugin, progressive-web-app, pwa, service-worker, service-workers, serviceworker, storage, webpack, webpack-plugin


offline-plugin logo

offline-plugin for webpack

backers sponsors npm npm


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 = 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 TypeScript see here

offline-plugin isn't working?

ℹ️ Troubleshooting | FAQ

Docs

Examples

Articles

Options

All options are optional and offline-plugin can be used without specifying them.

See all available options here.

Who is using offline-plugin

Projects

PWAs

If you are using offline-plugin, feel free to submit a PR to add your project to this list.

Like offline-plugin?

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

License

MIT
Logo

CHANGELOG

CHANGELOG

Project Statistics

Sourcerank 17
Repository Size 1.11 MB
Stars 3,942
Forks 258
Watchers 60
Open issues 78
Dependencies 18
Contributors 56
Tags 23
Created
Last updated
Last pushed

Top Contributors See all

Arthur Stolyar Alan Smithee heyli EGOIST Markus Stange Severin Zouhir ⚡️ Sean Matheson Timo Uhlmann Navkaran Garcha Alexander Wunschik MoOx James Newell Eduardo San Martin Morote Sarmad Sangi Xavier Damman Oden Cavitt Daniel Ruf The Gitter Badger

Packages Referencing this Repo

@yesmeck/offline-plugin
offline-plugin for webpack
Latest release 5.0.5 - Published - 3.94K stars
offline-plugin
offline-plugin for webpack
Latest release 5.0.7 - Updated - 3.94K stars
offline-plugin-patched
offline-plugin for webpack, patched for AppCache fixes
Latest release 5.0.6 - Updated - 3.94K stars
@mstange/offline-plugin
offline-plugin for webpack
Latest release 5.0.6 - Published - 3.94K stars
offline-plugin-steamer
offline-plugin for webpack
Latest release 1.0.0 - Published - 3.94K stars

Recent Tags See all

v5.0.7 May 03, 2019
v5.0.6 November 16, 2018
v5.0.5 June 02, 2018
v5.0.4 June 01, 2018
v5.0.3 May 04, 2018
v5.0.2 April 28, 2018
v5.0.1 April 27, 2018
v5.0.0 April 26, 2018
v4.9.1 April 26, 2018
v4.9.0 December 25, 2017
v4.8.5 December 07, 2017
v4.8.4 September 23, 2017
v4.8.3 July 11, 2017
v4.8.3-0 July 11, 2017
v4.8.2 July 11, 2017

Interesting Forks See all

willdurand/offline-plugin
Offline plugin (ServiceWorker, AppCache) for webpack (http://webpack.github.io/)
JavaScript - Last pushed - 3 stars - 1 forks
xwpongithub/offline-plugin
Offline plugin (ServiceWorker, AppCache) for webpack (http://webpack.github.io/)
JavaScript - Updated - 1 stars

Something wrong with this page? Make a suggestion

Last synced: 2019-05-03 13:03:11 UTC

Login to resync this repository