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-trackerVerified import paths — ran on the pinned version, not inferred.
Shows minimal webpack config using BundleTracker plugin to output stats JSON file.
Set environment variable NODE_OPTIONS=--openssl-legacy-provider before running webpack.
Move subdirectory segments from 'filename' to 'path' option.
No action required; upgrade to v3.2.1+.
Upgrade to webpack 5 or use v2.x.
If other plugins depend on the stats file, adjust plugin order or use compiler hooks.
npm install --save-dev webpack-bundle-tracker
Use: const BundleTracker = require('webpack-bundle-tracker');Ensure BundleTracker is in plugins array and webpack >=5 for v3.x.
Provide a valid path string: path: __dirname or path.resolve('./stats')