{"id":26026,"library":"nx-plugin-esbuild","title":"nx-plugin-esbuild","description":"Nx plugin for building Node.js and browser applications using ESBuild. Current stable version is 0.5.0. This package integrates ESBuild into the Nx build system as an executor, providing faster builds compared to traditional bundlers. It supports TypeScript, JSX, CSS, and code splitting. Key differentiators: native integration with @nrwl/devkit, uses ESBuild for speed, and requires @swc/core for TypeScript compilation. Release cadence is irregular; maintained by the community. It is inspired by @wanews/nx-esbuild but offers a different API and configuration style.","status":"active","version":"0.5.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","typescript"],"install":[{"cmd":"npm install nx-plugin-esbuild","lang":"bash","label":"npm"},{"cmd":"yarn add nx-plugin-esbuild","lang":"bash","label":"yarn"},{"cmd":"pnpm add nx-plugin-esbuild","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Nx plugin framework dependency","package":"@nrwl/devkit","optional":false},{"reason":"Nx workspace utilities","package":"@nrwl/workspace","optional":false},{"reason":"TypeScript compilation via SWC","package":"@swc/core","optional":false},{"reason":"Core bundler","package":"esbuild","optional":false},{"reason":"TypeScript language support","package":"typescript","optional":false}],"imports":[{"note":"ESM-only; use dynamic import if required from CJS.","wrong":"const EsbuildExecutor = require('nx-plugin-esbuild').EsbuildExecutor","symbol":"EsbuildExecutor","correct":"import { EsbuildExecutor } from 'nx-plugin-esbuild'"},{"note":"Type-only export for TypeScript users.","wrong":"const { EsbuildBuildOptions } = require('nx-plugin-esbuild')","symbol":"EsbuildBuildOptions","correct":"import type { EsbuildBuildOptions } from 'nx-plugin-esbuild'"},{"note":"Default export is a factory function, not a class.","wrong":"const NxPluginEsbuild = require('nx-plugin-esbuild')","symbol":"default","correct":"import NxPluginEsbuild from 'nx-plugin-esbuild'"}],"quickstart":{"code":"import { EsbuildExecutor } from 'nx-plugin-esbuild';\n\n// Example executor configuration\nconst options = {\n  entryPoints: ['src/main.ts'],\n  outfile: 'dist/main.js',\n  bundle: true,\n  platform: 'node',\n  target: 'node14',\n  tsconfig: 'tsconfig.json'\n};\n\nconst executor = new EsbuildExecutor(options, {\n  projectName: 'my-app',\n  root: '/path/to/project',\n  workspaceRoot: '/path/to/workspace'\n});\n\nawait executor.execute();\nconsole.log('Build complete!');","lang":"typescript","description":"Shows how to programmatically use the EsbuildExecutor to bundle a Node.js application."},"warnings":[{"fix":"Update to 0.5.0 and provide workspaceRoot in the executor context.","message":"The executor API changed in version 0.5.0; context object now requires workspaceRoot.","severity":"breaking","affected_versions":"<0.5.0"},{"fix":"Use default import as a function, not constructor.","message":"Default export changed from a class to a factory function in version 0.4.0.","severity":"breaking","affected_versions":"<0.4.0"},{"fix":"Do not remove @swc/core until officially announced.","message":"The @swc/core peer dependency is mandatory, but SWC may be optional in future versions.","severity":"deprecated","affected_versions":"~0.5.0"},{"fix":"Add these as devDependencies in your project.","message":"Requires @nrwl/devkit and @nrwl/workspace to be installed even if not directly used.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Check SWC compatibility for your TypeScript config (e.g., decorators, experimental features).","message":"TypeScript compilation relies on @swc/core, not tsc; ensure ESBuild or SWC handles decorators and other TypeScript features.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install @nrwl/devkit @nrwl/workspace'.","cause":"Missing peer dependency @nrwl/devkit.","error":"Cannot find module '@nrwl/devkit'"},{"fix":"Use ES module import (import { EsbuildExecutor } from 'nx-plugin-esbuild'). For CJS, use dynamic import: const { EsbuildExecutor } = await import('nx-plugin-esbuild').","cause":"Using require() with ESM-only package or outdated import style.","error":"TypeError: EsbuildExecutor is not a constructor"},{"fix":"Provide an object with workspaceRoot and other context properties: { projectName, root, workspaceRoot }.","cause":"The second argument to EsbuildExecutor constructor is missing workspaceRoot property.","error":"Error: The 'context' object must include 'workspaceRoot'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}