Registry / aws / arc-plugin-esbuild

arc-plugin-esbuild

JSON →
library3.0.0jsnpmunverified

A plugin for the Architect serverless framework that uses esbuild to bundle Lambda functions with dependency inclusion and tree-shaking. Version 3.0.0 introduces esbuild as the runtime, which is a breaking change requiring explicit runtime configuration. Active development with regular releases, targeting Node 14.13+ or 16+. Ships TypeScript types. Differentiator: integrates directly into Architect's `app.arc` config, supports config files for esbuild plugins, and allows custom build directories.

npm install arc-plugin-esbuild
INSTALL
IMPORT
SIG · ARC-PLUGIN-ESBUILD
A
arc-plugin-esbuild
awsjavascriptv3.0.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.

arc-plugin-esbuild
Add to app.arc: @plugins arc-plugin-esbuild
import in JavaScript
This is a plugin, not imported in code; configured via app.arc file.

Installs the plugin, configures app.arc with required pragmas, and creates a simple TypeScript handler.

npm i --save-dev arc-plugin-esbuild touch app.arc echo '@app myapp @aws runtime esbuild @http get / @plugins arc-plugin-esbuild' > app.arc # Create a handler file mkdir -p src/http/get-index touch src/http/get-index/index.ts # index.ts content: export async function handler(req: any) { return { statusCode: 200, body: 'Hello!' }; }
Debug
Known issues
breakingv3.0.0 changed esbuild from a build step to the runtime. You must set @aws runtime esbuild in your app.arc file.
fix
Add `@aws
runtime esbuild` to app.arc.
affects: >=3.0.0
deprecatedThe `plugin` build method is deprecated in favor of the new runtime mode.
fix
Migrate to runtime mode by setting @aws runtime esbuild.
affects: >=3.0.0
gotchaHydration (shared code) is not supported with custom runtimes. You must inline all shared code or use a build directory.
fix
Set `buildDirectory src` in @esbuild to avoid hydration issues.
affects: >=1.0.0
gotchaThe `external` option defaults to `aws-sdk`. If you need other external packages, you must list them explicitly.
fix
Add `external @prisma/client aws-sdk` to @esbuild pragma.
affects: >=2.3.0
Errors
Common errors & fixes
Error: [esbuild] Plugin arc-plugin-esbuild: buildDirectory must be set before runtime. Available: 'src'
Missing or misconfigured buildDirectory in app.arc @esbuild pragma.
fix
Add `@esbuild
buildDirectory src` to app.arc.
TypeError: Cannot destructure property 'get' of 'undefined' or null.
Missing @http pragma or incorrect indentation in app.arc.
fix
Ensure app.arc has proper pragmas and indentation: `@http
get /`.
Error: 'esbuild' is not in the npm registry.
Missing peer dependency esbuild.
fix
Run `npm install esbuild --save-dev`.
Upgrade
Version history
3.0.0latest on npm
Audit
Dependencies
esbuildrequiredPeer dependency for bundling functions
Agent activity
35 hits · last 30 days
node
30
OpenAI (training)
1
Resources