Registry / web-framework / appcache-webpack-plugin

appcache-webpack-plugin

JSON →
library1.4.0jsnpmunverified

Webpack plugin (v1.4.0, last updated 2016) to generate HTML5 Application Cache manifests (.appcache) for offline web apps. Supports cache, network, fallback, settings, and exclude options. Deprecated due to the HTML5 AppCache spec being removed from browsers. Alternatives: Service Workers. Webpack peer dependency: >=0.11 <=4.x.x.

npm install appcache-webpack-plugin
INSTALL
IMPORT
SIG · APPCACHE-WEBPACK-P
A
appcache-webpack-plugin
web-frameworkjavascriptv1.4.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AppCachePlugin
const AppCachePlugin = require('appcache-webpack-plugin');
import AppCachePlugin from 'appcache-webpack-plugin';
CommonJS only; no ESM export.
require('appcache-webpack-plugin')
const AppCachePlugin = require('appcache-webpack-plugin');
import AppCachePlugin from 'appcache-webpack-plugin';
Use require, not import.
plugin instantiation
new AppCachePlugin({ ... })
AppCachePlugin()
Must be instantiated with `new`.

Generates an appcache manifest with custom cache, network, fallback, exclude patterns, and output filename.

const HtmlWebpackPlugin = require('html-webpack-plugin'); const AppCachePlugin = require('appcache-webpack-plugin'); module.exports = { entry: './app.js', output: { path: './dist', filename: 'bundle.js' }, plugins: [ new HtmlWebpackPlugin(), new AppCachePlugin({ cache: ['image.jpg'], network: ['*'], fallback: ['fallback.html'], settings: ['prefer-online'], exclude: ['file.txt', /.*\.js$/], output: 'my-app.appcache' }) ] };
Debug
Known issues
deprecatedHTML5 Application Cache (AppCache) is deprecated and removed from modern browsers. Use Service Workers instead.
fix
Migrate to a service worker plugin like workbox-webpack-plugin.
affects: >=1.0.0
gotchaThe plugin outputs an .appcache file but does not update the HTML <html> manifest attribute automatically. You must do that manually or via another plugin.
fix
Add manifest='my-manifest.appcache' to the <html> tag in your HTML template.
affects: >=1.0.0
gotchaIf `network` option is not set, it defaults to ['*']; if you set it to null or an empty array, no network access is allowed.
fix
Explicitly set `network: ['*']` or `network: null` based on desired behavior.
affects: >=1.0.0
breakingWebpack 5 is not supported; this plugin only works with webpack <=4.x.x.
fix
Use an alternative plugin like serviceworker-webpack-plugin or workbox-webpack-plugin.
affects: >=1.0.0 <=1.4.0
gotchaExclude patterns: if you exclude .js files via /.*\.js$/, the bundle itself (a .js file) will be excluded from the manifest, which may not be intended.
fix
Double-check exclude patterns to ensure critical assets are not omitted.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'appcache-webpack-plugin'
npm package not installed.
fix
npm install appcache-webpack-plugin --save-dev
TypeError: AppCachePlugin is not a constructor
Using default import instead of require, or missing `new` keyword.
fix
Use `const AppCachePlugin = require('appcache-webpack-plugin');` and instantiate with `new`.
Error: webpack <version> does not support this plugin. Ensure webpack version is >=0.11 and <=4.x.x.
Incompatible webpack version.
fix
Downgrade webpack to 4.x.x or use a different plugin that supports your webpack version.
Upgrade
Version history
1.4.0latest on npm
Audit
Dependencies
webpackrequiredpeer dependency required for plugin integration
Agent activity
16 hits · last 30 days
node
14
Amazon
1
OpenAI (training)
1
Resources
appcache-webpack-plugin — npm install appcache-webpack-plugin · libregistry