Make a webpack-based web app load and run even when the user has no internet connection
Automatically cache all webpack output files so returning users get instant page loads from the local cache
Handle app updates gracefully so users get the new version the next time they open the app after going online
Requires an existing webpack project, two small edits to config and entry file are all that is needed.
This is a plugin for webpack, a tool that JavaScript developers use to bundle and package their web application's code. The plugin's job is to make a web app work without an internet connection, which is often called "offline-first" capability. When a user visits a site built with this plugin, the browser quietly saves a copy of the app's files locally so it can still run the next time there is no network available. The underlying technology it uses is called a Service Worker, which is a small background script the browser runs separately from the main page. Service Workers can intercept network requests and serve cached files instead, making the app feel fast and functional even on flaky connections. For older browsers that do not support Service Workers, the plugin falls back to an older, more limited browser feature called AppCache, which does a similar job of storing files locally. Setting it up involves two small steps. A developer adds the plugin to their webpack configuration file, and then adds one short line to their main JavaScript entry file to activate the offline runtime. Everything else is handled automatically. The plugin figures out which files webpack produces and takes care of caching them. All configuration options are optional, so a basic setup requires no extra decisions. The project has documentation covering topics like how updates are handled when you ship a new version of your app, how to control which files get cached, and how to use it with TypeScript. There are also troubleshooting guides and a FAQ section for common problems. The plugin has attracted over 4,500 stars on GitHub, indicating it has been widely used in production web projects.
← nekr on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.