Registry / web-framework / webpack-bundle-tracker

webpack-bundle-tracker

JSON →
library3.2.3jsnpmunverified

Webpack plugin that outputs compilation statistics (status, chunks, assets) to a JSON file, primarily designed to integrate with django-webpack-loader for server-side rendering of webpack bundles in Django projects. Current stable version: 3.2.3 (released January 2025). Releases are synced with django-webpack-loader. Key differentiators: supports integrity hashes, relative paths, log timing, and compiles down to CJS for Node.js compatibility. Requires Node >=20.0.0. Provides TypeScript type definitions.

npm install webpack-bundle-tracker
INSTALL
IMPORT
SIG · WEBPACK-BUNDLE-TRA
W
webpack-bundle-tracker
web-frameworkjavascriptv3.2.3
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.

BundleTracker
const BundleTracker = require('webpack-bundle-tracker');
import BundleTracker from 'webpack-bundle-tracker';
Package is CJS-only; no ESM export. Use require().
BundleTracker
const Plugin = require('webpack-bundle-tracker');
const { BundleTracker } = require('webpack-bundle-tracker');
Export is default, not named. Destructuring will yield undefined.
BundleTrackerOptions
import type { BundleTrackerOptions } from 'webpack-bundle-tracker';
TypeScript users can import the type for options (path, filename, etc.).

Shows minimal webpack config using BundleTracker plugin to output stats JSON file.

const path = require('path'); const BundleTracker = require('webpack-bundle-tracker'); module.exports = { context: __dirname, entry: './src/index.js', output: { path: path.resolve('./dist'), filename: '[name]-[contenthash].js', }, plugins: [ new BundleTracker({ path: __dirname, filename: 'webpack-stats.json', }), ], };
Debug
Known issues
breakingNode.js >=17 with OpenSSL v3 breaks Webpack@4; set NODE_OPTIONS=--openssl-legacy-provider.
fix
Set environment variable NODE_OPTIONS=--openssl-legacy-provider before running webpack.
affects: >=17.0.0
breakingMigrating from v1 to v2: 'path' option now used with 'filename' to generate output path; subdirectories in 'filename' no longer allowed.
fix
Move subdirectory segments from 'filename' to 'path' option.
affects: >=2.0.0
deprecatedlodash dependency removed in v3.2.1; no migration needed but ensure no reliance on internal lodash polyfills.
fix
No action required; upgrade to v3.2.1+.
affects: >=3.2.1
breakingVersion 3.0.0 requires webpack 5 (publicPath: auto support removed for webpack 4).
fix
Upgrade to webpack 5 or use v2.x.
affects: >=3.0.0
gotchaThe stats JSON is emitted on the 'emit' hook; ensure plugins order if using other emit plugins.
fix
If other plugins depend on the stats file, adjust plugin order or use compiler hooks.
affects: all
Errors
Common errors & fixes
Cannot find module 'webpack-bundle-tracker'
Package not installed or dev dependency missing.
fix
npm install --save-dev webpack-bundle-tracker
BundleTracker is not a constructor
Importing as named export instead of default.
fix
Use: const BundleTracker = require('webpack-bundle-tracker');
TypeError: Cannot read properties of undefined (reading 'compilation')
Plugin instantiated outside webpack plugin array or webpack version incompatible.
fix
Ensure BundleTracker is in plugins array and webpack >=5 for v3.x.
The 'path' argument must be of type string. Received undefined
Missing or incorrect 'path' option in plugin constructor.
fix
Provide a valid path string: path: __dirname or path.resolve('./stats')
Upgrade
Version history
3.2.3latest on npm
Audit
Dependencies
webpackoptionalPeer dependency; plugin runs within webpack compilation lifecycle.
Agent activity
18 hits · last 30 days
node
14
OpenAI (training)
1
Resources