offline-plugin

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

Github星跟踪图






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

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?

:information_source: 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

主要指标

概览
名称与所有者NekR/offline-plugin
主编程语言JavaScript
编程语言JavaScript (语言数: 3)
平台
许可证MIT License
所有者活动
创建于2015-09-11 17:03:50
推送于2021-11-08 05:42:32
最后一次提交2019-05-24 03:07:31
发布数23
最新版本名称v5.0.7 (发布于 2019-05-03 16:01:56)
第一版名称v4.5.4 (发布于 2017-01-08 17:45:36)
用户参与
星数4.5k
关注者数57
派生数291
提交数700
已启用问题?
问题数374
打开的问题数96
拉请求数88
打开的拉请求数13
关闭的拉请求数29
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?