Volver al ranking

NekR/offline-plugin

JavaScript

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

service-workerappcachewebpackserviceworkerpwaofflineprogressive-web-appstoragepluginwebpack-pluginoffline-firstservice-workers
Crecimiento de estrellas
Estrellas
4.5k
Forks
288
Crecimiento semanal
Issues
96
2k4k
sept 2015abr 2019dic 2022jul 2026
Artefactosnpmnpm install offline-plugin
README



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?

: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

Repositorios relacionados
mswjs/msw

Industry standard API mocking for JavaScript.

TypeScriptnpmMIT Licensemswmock
mswjs.io
18.1k614
GoogleChrome/workbox

📦 Workbox: JavaScript libraries for Progressive Web Apps

JavaScriptnpmMIT Licenseservice-workerprogressive-web-app
developers.google.com/web/tools/workbox/
13k877
GoogleChromeLabs/sw-precache

[Deprecated] A node module to generate service worker code that will precache specific resources so they work offline.

JavaScriptnpmApache License 2.0javascriptservice-workers
developers.google.com/web/tools/workbox/guides/migrations/migrate-from-sw
5.2k381
TalAter/UpUp

✈️ Easily create sites that work offline as well as online

JavaScriptnpmMIT Licensehacktoberfestpwa
talater.com/upup/
4.9k260
hemanth/awesome-pwa

Awesome list of progressive web apps!

JavaScriptnpmpwaservice-worker
git.io/awesome-pwa
4.9k564
jimmywarting/StreamSaver.js

StreamSaver writes stream to the filesystem directly asynchronous

JavaScriptnpmMIT Licensestreamservice-worker
jimmywarting.github.io/StreamSaver.js/example.html
4.4k441
mgechev/angular-performance-checklist

⚡ Cheatsheet for developing lightning fast progressive Angular applications

MIT Licenseangularperformance
4.1k454
shadowwalker/next-pwa

Zero config PWA plugin for Next.js, with workbox 🧰

JavaScriptnpmMIT Licensepwanextjs
4.1k339
gildas-lormeau/zip.js

JavaScript library to zip and unzip files supporting parallel compression, web streams, zip64, split files, data encryption, and deflate64 decompression.

JavaScriptnpmBSD 3-Clause "New" or "Revised" Licensezipjavascript
gildas-lormeau.github.io/zip.js
3.9k543
pwa-builder/PWABuilder

The simplest way to create progressive web apps across platforms and devices. Start here. This repo is home to several projects in the PWABuilder family of tools.

TypeScriptnpmOtherpwabuilderpwa
docs.pwabuilder.com
3.7k390
GoogleChromeLabs/sw-toolbox

[Deprecated] A collection of service worker tools for offlining runtime requests

JavaScriptnpmApache License 2.0javascriptservice-worker
developers.google.com/web/tools/workbox/guides/migrations/migrate-from-sw
3.6k323
SangKa/PWA-Book-CN

第一本 PWA 中文书

pwapwa-book
item.jd.com/12365091.html
3.4k413