{"id":18954,"library":"af-webpack","title":"af-webpack","description":"Internal webpack configuration wrapper used by Ant Financial and UmiJS. Version 1.14.9 is the latest stable release, but active development has moved to the Utoopack bundler within UmiJS v4+. Originally designed to abstract webpack complexities, it is now effectively superseded by utoopack. Key differentiator: provides a unique, opinionated webpack interface tailored for Ant Financial's ecosystem.","status":"deprecated","version":"1.14.9","language":"javascript","source_language":"en","source_url":"https://github.com/umijs/umi/tree/master/packages/af-webpack","tags":["javascript"],"install":[{"cmd":"npm install af-webpack","lang":"bash","label":"npm"},{"cmd":"yarn add af-webpack","lang":"bash","label":"yarn"},{"cmd":"pnpm add af-webpack","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; not available as default export.","wrong":"const { Config } = require('af-webpack')","symbol":"Config","correct":"import { Config } from 'af-webpack'"},{"note":"Named export, not a default export.","wrong":"import getUserConfig from 'af-webpack'","symbol":"getUserConfig","correct":"import { getUserConfig } from 'af-webpack'"},{"note":"Use this for programmatic access to the generated webpack config.","symbol":"getConfig","correct":"import { getConfig } from 'af-webpack'"}],"quickstart":{"code":"import { getConfig } from 'af-webpack';\n\nconst config = getConfig({\n  cwd: process.cwd(),\n  entry: {\n    app: './src/index.js',\n  },\n  output: {\n    path: './dist',\n    filename: '[name].[hash].js',\n  },\n  env: process.env.NODE_ENV || 'development',\n});\n\n// config is a webpack configuration object\nconsole.log(config);","lang":"javascript","description":"Demonstrates generating a webpack configuration object using af-webpack's getConfig function."},"warnings":[{"fix":"Migrate to UmiJS v4+ and use utoopack or directly use webpack 5.","message":"af-webpack is deprecated in favor of utoopack. New projects should use UmiJS v4+ which bundles utoopack.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use webpack 4 or manually adapt configurations for webpack 5 compatibility.","message":"Incompatible with webpack 5 without modifications. af-webpack was designed for webpack 4 and may not work out-of-the-box with webpack 5.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Refer to af-webpack documentation for its unique configuration schema.","message":"Configuration keys may differ from standard webpack. For example, `useHash` instead of `filename: '[hash]'`.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install af-webpack@1.14.9 --save-dev","cause":"Package not installed or version mismatch.","error":"Error: Cannot find module 'af-webpack'"},{"fix":"Use import { getConfig } from 'af-webpack' instead of import getConfig from 'af-webpack'.","cause":"Incorrect import (default instead of named).","error":"TypeError: getConfig is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}