{"id":20717,"library":"webpack-bundle-tracker","title":"webpack-bundle-tracker","description":"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.","status":"active","version":"3.2.3","language":"javascript","source_language":"en","source_url":"https://github.com/django-webpack/webpack-bundle-tracker","tags":["javascript","bundle","files","plugin","stats","webpack","typescript"],"install":[{"cmd":"npm install webpack-bundle-tracker","lang":"bash","label":"npm"},{"cmd":"yarn add webpack-bundle-tracker","lang":"bash","label":"yarn"},{"cmd":"pnpm add webpack-bundle-tracker","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; plugin runs within webpack compilation lifecycle.","package":"webpack","optional":true}],"imports":[{"note":"Package is CJS-only; no ESM export. Use require().","wrong":"import BundleTracker from 'webpack-bundle-tracker';","symbol":"BundleTracker","correct":"const BundleTracker = require('webpack-bundle-tracker');"},{"note":"Export is default, not named. Destructuring will yield undefined.","wrong":"const { BundleTracker } = require('webpack-bundle-tracker');","symbol":"BundleTracker","correct":"const Plugin = require('webpack-bundle-tracker');"},{"note":"TypeScript users can import the type for options (path, filename, etc.).","wrong":"","symbol":"BundleTrackerOptions","correct":"import type { BundleTrackerOptions } from 'webpack-bundle-tracker';"}],"quickstart":{"code":"const path = require('path');\nconst BundleTracker = require('webpack-bundle-tracker');\n\nmodule.exports = {\n  context: __dirname,\n  entry: './src/index.js',\n  output: {\n    path: path.resolve('./dist'),\n    filename: '[name]-[contenthash].js',\n  },\n  plugins: [\n    new BundleTracker({\n      path: __dirname,\n      filename: 'webpack-stats.json',\n    }),\n  ],\n};","lang":"javascript","description":"Shows minimal webpack config using BundleTracker plugin to output stats JSON file."},"warnings":[{"fix":"Set environment variable NODE_OPTIONS=--openssl-legacy-provider before running webpack.","message":"Node.js >=17 with OpenSSL v3 breaks Webpack@4; set NODE_OPTIONS=--openssl-legacy-provider.","severity":"breaking","affected_versions":">=17.0.0"},{"fix":"Move subdirectory segments from 'filename' to 'path' option.","message":"Migrating from v1 to v2: 'path' option now used with 'filename' to generate output path; subdirectories in 'filename' no longer allowed.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"No action required; upgrade to v3.2.1+.","message":"lodash dependency removed in v3.2.1; no migration needed but ensure no reliance on internal lodash polyfills.","severity":"deprecated","affected_versions":">=3.2.1"},{"fix":"Upgrade to webpack 5 or use v2.x.","message":"Version 3.0.0 requires webpack 5 (publicPath: auto support removed for webpack 4).","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"If other plugins depend on the stats file, adjust plugin order or use compiler hooks.","message":"The stats JSON is emitted on the 'emit' hook; ensure plugins order if using other emit plugins.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'20.0.0':72 '2025':44 '3.2.3':41 'asset':13 'bundl':3,34,78 'chunk':12 'cjs':66 'compat':69 'compil':9,63 'current':38 'definit':76 'design':19 'differenti':54 'django':24,36,50 'django-webpack-load':23,49 'file':17,79 'hash':57 'integr':21,56 'januari':43 'javascript':77 'json':16 'key':53 'loader':26,52 'log':60 'node':71 'node.js':68 'output':8 'path':59 'plugin':6,80 'primarili':18 'project':37 'provid':73 'relat':58 'releas':42,45 'render':31 'requir':70 'server':29 'server-sid':28 'side':30 'stabl':39 'stat':81 'statist':10 'status':11 'support':55 'sync':47 'time':61 'tracker':4 'type':75 'typescript':74,83 'version':40 'webpack':2,5,25,33,51,82 'webpack-bundle-track':1","created_at":"2026-04-25T11:24:36.173181+00:00","updated_at":"2026-04-25T11:24:36.173181+00:00","problems":[{"fix":"npm install --save-dev webpack-bundle-tracker","cause":"Package not installed or dev dependency missing.","error":"Cannot find module 'webpack-bundle-tracker'"},{"fix":"Use: const BundleTracker = require('webpack-bundle-tracker');","cause":"Importing as named export instead of default.","error":"BundleTracker is not a constructor"},{"fix":"Ensure BundleTracker is in plugins array and webpack >=5 for v3.x.","cause":"Plugin instantiated outside webpack plugin array or webpack version incompatible.","error":"TypeError: Cannot read properties of undefined (reading 'compilation')"},{"fix":"Provide a valid path string: path: __dirname or path.resolve('./stats')","cause":"Missing or incorrect 'path' option in plugin constructor.","error":"The 'path' argument must be of type string. Received undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/django-webpack/webpack-bundle-tracker","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/webpack-bundle-tracker","openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}