Skip to content
Offline plugin (ServiceWorker, AppCache) for webpack (https://webpack.js.org/)
JavaScript Other
Branch: master
Clone or download
Latest commit 2b51a89 May 24, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Create FUNDING.yml May 24, 2019
build Improve package dependencies handling and requiring of UglifyJsPlugin Mar 8, 2018
configs Update eslint and use babel-eslint so that the dynamic import syntax … Sep 7, 2018
docs add faq and troubleshooting entry regarding insecure response (#333) Feb 13, 2019
lib Build project May 3, 2019
logo Update LICENSE.md Feb 18, 2017
src Merge branch 'master' into fix-wasm May 3, 2019
tests Update textures May 3, 2019
tpls getRegistration Scope (#439) Mar 1, 2019
.appveyor.yml Merge pull request #392 from DanielRuf/chore/add-nodejs-10 Jun 25, 2018
.gitignore getRegistration Scope (#439) Mar 1, 2019
.travis.yml
CHANGELOG.md Update CHANGELOG.md Apr 23, 2018
CONTRIBUTING.md Create CONTRIBUTING.md Jun 14, 2017
LICENSE.md Add LICENSE Sep 18, 2015
README.md catched a typo Dec 16, 2018
index.html add edit link Dec 16, 2018
package.json [ci skip] Release 5.0.7 May 3, 2019
runtime.d.ts Fix runtime typings. May 20, 2017
runtime.js Improve option and add runtime.update() Jan 31, 2017

README.md

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

You can’t perform that action at this time.