MCPcopy Index your code
hub / github.com/NekR/offline-plugin

github.com/NekR/offline-plugin @v5.0.7

Chat with this repo
repository ↗ · DeepWiki ↗ · release v5.0.7 ↗ · + Follow
907 symbols 1,936 edges 369 files 0 documented · 0% 3 cross-repo links updated 4y agov5.0.7 · 2019-05-03★ 4,51096 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
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

Demo:

Progressive Web App built with offline-plugin

(source code)

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]

<img src="http

Extension points exported contracts — how you extend this code

InstallOptions (Interface)
(no doc)
runtime.d.ts

Core symbols most depended-on inside this repo

validatePaths
called by 12
src/index.js
_interopRequireDefault
called by 9
lib/index.js
useTools
called by 8
src/index.js
apply
called by 7
src/app-cache.js
cache
called by 6
lib/service-worker.js
a
called by 6
tests/legacy/fixtures/sw-minify-auto/__expected/webpack2/sw.js
a
called by 6
tests/legacy/fixtures/sw-minify-auto/__expected/webpack3/sw.js
a
called by 6
tests/legacy/fixtures/sw-minify-true/__expected/webpack2/sw.js

Shape

Function 870
Method 30
Class 6
Interface 1

Languages

TypeScript100%

Modules by API surface

tests/legacy/fixtures/sw-minify-false/__expected/webpack4/sw.js26 symbols
tests/legacy/fixtures/sw-minify-false/__expected/webpack3/sw.js26 symbols
tests/legacy/fixtures/sw-minify-false/__expected/webpack2/sw.js26 symbols
tests/legacy/fixtures/cachemaps-basic/__expected/webpack4/sw.js26 symbols
tests/legacy/fixtures/cachemaps-basic/__expected/webpack3/sw.js26 symbols
tests/legacy/fixtures/cachemaps-basic/__expected/webpack2/sw.js26 symbols
tests/legacy/fixtures/basic-with-sw-custom-entry/__expected/webpack4/sw.js26 symbols
tests/legacy/fixtures/basic-with-sw-custom-entry/__expected/webpack3/sw.js26 symbols
tests/legacy/fixtures/basic-with-sw-custom-entry/__expected/webpack2/sw.js26 symbols
tests/legacy/fixtures/basic-wIth-sw-out/__expected/webpack4/sw.js26 symbols
tests/legacy/fixtures/basic-wIth-sw-out/__expected/webpack3/sw.js26 symbols
tests/legacy/fixtures/basic-wIth-sw-out/__expected/webpack2/sw.js26 symbols

Dependencies from manifests, versioned

babel-eslint9.0.0 · 1×
chalk1.1.3 · 1×
cli-highlight1.1.4 · 1×
copy-webpack-plugin4.2.0 · 1×
deep-extend0.5.1 · 1×
del2.2.2 · 1×
diff3.0.1 · 1×
dir-compare1.1.0 · 1×
ejs2.3.4 · 1×
eslint5.5.0 · 1×
express4.16.2 · 1×
fs-extra5.0.0 · 1×

For agents

$ claude mcp add offline-plugin \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact