Registry / devops / nx-plugin-esbuild

nx-plugin-esbuild

JSON →
library0.5.0jsnpmunverified

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.

npm install nx-plugin-esbuild
INSTALL
IMPORT
SIG · NX-PLUGIN-ESBUILD
N
nx-plugin-esbuild
devopsjavascriptv0.5.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

EsbuildExecutor
import { EsbuildExecutor } from 'nx-plugin-esbuild'
const EsbuildExecutor = require('nx-plugin-esbuild').EsbuildExecutor
ESM-only; use dynamic import if required from CJS.
EsbuildBuildOptions
import type { EsbuildBuildOptions } from 'nx-plugin-esbuild'
const { EsbuildBuildOptions } = require('nx-plugin-esbuild')
Type-only export for TypeScript users.
default
import NxPluginEsbuild from 'nx-plugin-esbuild'
const NxPluginEsbuild = require('nx-plugin-esbuild')
Default export is a factory function, not a class.

Shows how to programmatically use the EsbuildExecutor to bundle a Node.js application.

import { EsbuildExecutor } from 'nx-plugin-esbuild'; // Example executor configuration const options = { entryPoints: ['src/main.ts'], outfile: 'dist/main.js', bundle: true, platform: 'node', target: 'node14', tsconfig: 'tsconfig.json' }; const executor = new EsbuildExecutor(options, { projectName: 'my-app', root: '/path/to/project', workspaceRoot: '/path/to/workspace' }); await executor.execute(); console.log('Build complete!');
Debug
Known issues
breakingThe executor API changed in version 0.5.0; context object now requires workspaceRoot.
fix
Update to 0.5.0 and provide workspaceRoot in the executor context.
affects: <0.5.0
breakingDefault export changed from a class to a factory function in version 0.4.0.
fix
Use default import as a function, not constructor.
affects: <0.4.0
deprecatedThe @swc/core peer dependency is mandatory, but SWC may be optional in future versions.
fix
Do not remove @swc/core until officially announced.
affects: ~0.5.0
gotchaRequires @nrwl/devkit and @nrwl/workspace to be installed even if not directly used.
fix
Add these as devDependencies in your project.
affects: >=0.1.0
gotchaTypeScript compilation relies on @swc/core, not tsc; ensure ESBuild or SWC handles decorators and other TypeScript features.
fix
Check SWC compatibility for your TypeScript config (e.g., decorators, experimental features).
affects: >=0.1.0
Errors
Common errors & fixes
Cannot find module '@nrwl/devkit'
Missing peer dependency @nrwl/devkit.
fix
Run 'npm install @nrwl/devkit @nrwl/workspace'.
TypeError: EsbuildExecutor is not a constructor
Using require() with ESM-only package or outdated import style.
fix
Use ES module import (import { EsbuildExecutor } from 'nx-plugin-esbuild'). For CJS, use dynamic import: const { EsbuildExecutor } = await import('nx-plugin-esbuild').
Error: The 'context' object must include 'workspaceRoot'
The second argument to EsbuildExecutor constructor is missing workspaceRoot property.
fix
Provide an object with workspaceRoot and other context properties: { projectName, root, workspaceRoot }.
Upgrade
Version history
0.5.0latest on npm
Audit
Dependencies
@nrwl/devkitrequiredNx plugin framework dependency
@nrwl/workspacerequiredNx workspace utilities
@swc/corerequiredTypeScript compilation via SWC
esbuildrequiredCore bundler
typescriptrequiredTypeScript language support
Agent activity
2 hits · last 30 days
node
2
Resources
nx-plugin-esbuild — npm install nx-plugin-esbuild · libregistry