{"id":18138,"library":"avet-build","title":"avet-build","description":"avet-build is a build tool for avet, a framework for building server-rendered React applications. This package provides webpack build configurations used in the avet ecosystem. Version 1.4.4 is the latest stable release, with no recent updates since 2018. It is part of the avet monorepo and is designed to work with Node.js >= 8. Key differentiator: integrates with avet's build pipeline, handling webpack bundling for both client and server, and supports features like babel transpilation, static file serving, and environment variable injection. Unlike generic build tools, it is tightly coupled to avet's project structure.","status":"maintenance","version":"1.4.4","language":"javascript","source_language":"en","source_url":"https://github.com/avetjs/avet","tags":["javascript"],"install":[{"cmd":"npm install avet-build","lang":"bash","label":"npm"},{"cmd":"yarn add avet-build","lang":"bash","label":"yarn"},{"cmd":"pnpm add avet-build","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core bundler for building the application","package":"webpack","optional":false},{"reason":"Transpile modern JavaScript and JSX","package":"babel-loader","optional":true},{"reason":"Framework dependency for avet","package":"egg-framework","optional":true}],"imports":[{"note":"The package is an ESM module; default import returns the build function.","wrong":"const build = require('avet-build')","symbol":"default (build function)","correct":"import build from 'avet-build'"},{"note":"The webpack config is not exported at the top level; access via lib/webpack.","wrong":"const buildConfig = require('avet-build').config","symbol":"default (webpack config)","correct":"import buildConfig from 'avet-build/lib/webpack'"},{"note":"Path utilities are not exported from the main entry; import from subpath.","wrong":"import { resolveApp } from 'avet-build'","symbol":"Path utilities","correct":"import { resolveApp } from 'avet-build/lib/paths'"}],"quickstart":{"code":"import build from 'avet-build';\n\nasync function start() {\n  try {\n    const result = await build({\n      cwd: process.cwd(),\n      env: process.env.NODE_ENV || 'production',\n      analyze: false,\n    });\n    console.log('Build completed:', result);\n  } catch (err) {\n    console.error('Build failed:', err);\n    process.exit(1);\n  }\n}\n\nstart();","lang":"typescript","description":"Demonstrates programmatic build using avet-build with async/await and error handling."},"warnings":[{"fix":"Set process.env.NODE_ENV = 'production' before calling build, or pass env option as 'production'.","message":"NODE_ENV must be set to 'production' for optimized builds; otherwise development bundles are emitted","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Do not install webpack 4+ or plugins expecting webpack 4. Use only webpack 3 compatible loaders/plugins.","message":"avet-build uses webpack 3.x internally; incompatible with webpack 4+ plugins","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider migrating to a maintained alternative or audit dependencies with npm audit.","message":"The package has not been updated since 2018; may have unpatched security vulnerabilities in transitive dependencies","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use async/await or .then() instead of callback pattern.","message":"The build function no longer accepts a callback; must return a promise","severity":"deprecated","affected_versions":">=1.0.0-18"},{"fix":"Update Node.js to >=8 or use a compatible version.","message":"Minimum Node.js version is 8; Node.js 6 and below are not supported","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Ensure custom config arrays (e.g., plugins, loaders) are concatenated, not overridden.","message":"Custom webpack config is merged via webpack-merge; deep merging may produce unexpected results for arrays","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 webpack@3 --save-dev","cause":"avet-build requires webpack as a peer dependency but it is not installed","error":"Error: Cannot find module 'webpack'"},{"fix":"Use import build from 'avet-build'","cause":"Importing the module incorrectly, e.g., using require('avet-build').default without default export","error":"TypeError: build is not a function"},{"fix":"Ensure the project has the required avet structure (e.g., build/config/webpack.js)","cause":"avet-build expects a project structure with a 'build' directory or specific config files","error":"Error: No configuration found for webpack"},{"fix":"npm install babel-loader@7 --save-dev","cause":"babel-loader is not installed as a dependency","error":"Module not found: Error: Can't resolve 'babel-loader'"},{"fix":"Pass e.g., { env: 'production' } or set process.env.NODE_ENV accordingly","cause":"The 'env' option passed to build() is incorrect or missing","error":"Error: The provided value 'NODE_ENV' is not a valid environment"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}