19

GitHub - NekR/offline-plugin: Offline plugin (ServiceWorker, AppCache) for webp...

 6 years ago
source link: https://github.com/NekR/offline-plugin
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

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

68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f302f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f312f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f322f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f332f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f342f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f352f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f362f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f372f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f382f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f392f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f31302f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f31312f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f31322f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f31332f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f31342f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f31352f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f31362f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f31372f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f31382f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f31392f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f32302f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f32312f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f32322f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f32332f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f32342f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f32352f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f32362f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f32372f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f32382f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f73706f6e736f722f32392f6176617461722e737667

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 with options 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()
  ]
  // ...
}

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]

68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f302f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f312f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f322f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f332f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f342f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f352f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f362f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f372f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f382f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f392f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f31302f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f31312f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f31322f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f31332f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f31342f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f31352f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f31362f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f31372f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f31382f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f31392f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f32302f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f32312f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f32322f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f32332f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f32342f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f32352f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f32362f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f32372f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f32382f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f6f66666c696e652d706c7567696e2f6261636b65722f32392f6176617461722e737667

Contribution

See CONTRIBUTING

License

MIT
Logo

CHANGELOG

CHANGELOG


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK