{"id":26643,"library":"webpack-asset-file-plugin","title":"webpack-asset-file-plugin","description":"A webpack plugin (v1.0.2) that generates asset files (e.g., JSON) containing the mapping of webpack output assets with their sizes and hash values. It is designed for webpack 4 and helps track compiled assets. The plugin writes an asset.json file to the output directory with details like filename, size, and hash. It is a niche tool compared to plugins like assets-webpack-plugin or webpack-manifest-plugin, which are more feature-rich and actively maintained. Release cadence is low (latest 2018), with no recent updates.","status":"maintenance","version":"1.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/hubcarl/webpack-asset-file-plugin","tags":["javascript","webpack","webpack 4","asset file html"],"install":[{"cmd":"npm install webpack-asset-file-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add webpack-asset-file-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add webpack-asset-file-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency for webpack 4","package":"webpack","optional":false}],"imports":[{"note":"Default export; CommonJS require works but .default is not needed.","wrong":"const AssetFilePlugin = require('webpack-asset-file-plugin').default","symbol":"AssetFilePlugin","correct":"import AssetFilePlugin from 'webpack-asset-file-plugin'"},{"note":"Named export does not exist; do not destructure.","wrong":"const { AssetFilePlugin } = require('webpack-asset-file-plugin')","symbol":"AssetFilePlugin","correct":"const AssetFilePlugin = require('webpack-asset-file-plugin')"}],"quickstart":{"code":"const AssetFilePlugin = require('webpack-asset-file-plugin');\n\nmodule.exports = {\n  entry: './src/index.js',\n  output: {\n    path: path.resolve(__dirname, 'dist'),\n    filename: 'bundle.js',\n  },\n  plugins: [\n    new AssetFilePlugin({\n      filename: 'asset.json',\n      excludeAssets: [/.*\\.map$/],\n      update: false,\n      path: path.resolve(__dirname, 'dist'),\n    }),\n  ],\n};","lang":"javascript","description":"Shows how to configure the plugin to output asset.json with compiled file details, excluding source maps."},"warnings":[{"fix":"Use an alternative like webpack-manifest-plugin for webpack 5.","message":"Plugin is designed for webpack 4 only; may not work with webpack 5 due to removed hooks.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Switch to actively maintained plugins like assets-webpack-plugin or webpack-manifest-plugin.","message":"The package has not been updated since 2018; consider it in maintenance mode.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Set `update: true` to merge with existing asset file, if that behavior is desired.","message":"The `update` option set to false will overwrite the asset file on each build instead of merging.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'2018':89 '4':34,97 'activ':82 'asset':3,12,22,39,67,98 'asset.json':44 'assets-webpack-plugin':66 'cadenc':85 'compar':62 'compil':38 'contain':16 'design':31 'detail':51 'directori':49 'e.g':14 'featur':79 'feature-rich':78 'file':4,13,45,99 'filenam':53 'generat':11 'hash':27,56 'help':36 'html':100 'javascript':94 'json':15 'latest':88 'like':52,65 'low':87 'maintain':83 'manifest':73 'map':18 'nich':60 'output':21,48 'plugin':5,8,41,64,69,74 'recent':92 'releas':84 'rich':80 'size':25,54 'tool':61 'track':37 'updat':93 'v1.0.2':9 'valu':28 'webpack':2,7,20,33,68,72,95,96 'webpack-asset-file-plugin':1 'webpack-manifest-plugin':71 'write':42","created_at":"2026-05-01T13:51:02.472345+00:00","updated_at":"2026-05-01T13:51:02.472345+00:00","problems":[{"fix":"Ensure plugin is instantiated and added to webpack's `plugins` array in config.","cause":"Plugin applied incorrectly, or not added to plugins array.","error":"TypeError: Cannot read property 'compilation' of undefined"},{"fix":"Add `filename` option, e.g., `new AssetFilePlugin({ filename: 'assets.json' })`.","cause":"Missing `filename` option when instantiating plugin.","error":"Error: [webpack-asset-file-plugin] options.filename is required"}],"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/hubcarl/webpack-asset-file-plugin","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/webpack-asset-file-plugin","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}