Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

NotificationsYou must be signed in to change notification settings

NekR/offline-plugin

Repository files navigation

offline-plugin logo

offline-plugin for webpack

backerssponsorsnpmnpm


This plugin is intended to provide an offline experience forwebpack projects. It usesServiceWorker, andAppCache as a fallback under the hood. Simply include this plugin in yourwebpack.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 yourwebpack.config:

// webpack.config.js examplevarOfflinePlugin=require('offline-plugin');module.exports={// ...plugins:[// ... other plugins// it's always better if OfflinePlugin is the last plugin addednewOfflinePlugin()]// ...}

(and optionally configure withoptions)

Then, add theruntime into your entry file (typically main entry):

require('offline-plugin/runtime').install();

ES6/Babel/TypeScript

import*asOfflinePluginRuntimefrom'offline-plugin/runtime';OfflinePluginRuntime.install();

For more details of usage withTypeScript seehere

offline-plugin isn't working?

ℹ️Troubleshooting |FAQ

Docs

Examples

Articles

Options

All options are optional andoffline-plugin can be used without specifying them.

Who is usingoffline-plugin

Projects

PWAs

If you are usingoffline-plugin, feel free to submit a PR to add your project to this list.

Likeoffline-plugin?

Support it by givingfeedback,contributing, becoming abacker/sponsor or just by 🌟 starring the project!

Backers

Support us with a monthly donation and help us continue our activities. [Become a backer]

Contribution

SeeCONTRIBUTING

License

MIT
Logo

CHANGELOG

CHANGELOG

Sponsor this project

    Packages

    No packages published

    Contributors55

    Languages


    [8]ページ先頭

    ©2009-2025 Movatter.jp