Webpack plugin that solves the problem of generating JS files for manifest.json entries in web extensions (Chrome, Firefox, Edge, Opera). It automatically finds JS files referenced in the manifest entry, copies the manifest to the output, and removes the generated JS file from the compilation to avoid duplicate or extraneous output. Version 1.4.1 supports both webpack 4 and 5. It is commonly used with wext-manifest-loader and the web-extension-starter project. The plugin is maintained by a single developer with updates focused on compatibility and stability. It fills a niche gap not addressed by other webpack extension plugins like @pmmmwh/react-refresh-webpack-plugin or webpack-ext-reloader by providing a minimal, focused solution for manifest handling.
npm install wext-manifest-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic webpack config using the plugin with wext-manifest-loader for a Chrome extension.
Add wext-manifest-loader as a devDependency and configure a webpack rule for manifest.json with type: 'javascript/auto'.
Instantiate with new WextManifestWebpackPlugin() without arguments.
Use require() or configure bundler accordingly.
Upgrade to wext-manifest-webpack-plugin >=1.4.0 and webpack >=5.
Use const WextManifestWebpackPlugin = require('wext-manifest-webpack-plugin');Install wext-manifest-loader: npm install --save-dev wext-manifest-loader
Add rule with type: 'javascript/auto' and use: 'wext-manifest-loader' for manifest.json files.
No dependency data recorded yet.