Registry / web-framework / esbuild-esm-loader

esbuild-esm-loader

JSON →
library0.3.3jsnpmunverified

ESM loader for Node.js that transforms imports using ESBuild, supporting TypeScript, JSX, and modern JavaScript. Current stable version is 0.3.3 (major version zero, so minor versions may include breaking changes). Requires Node.js >=16.17.0 and ESBuild as a peer dependency. It uses Node.js module customization hooks (--import) for transparent transformation without a build step. Alternative to ts-node, tsx, or jiti; focuses purely on ESBuild integration.

npm install esbuild-esm-loader
INSTALL
IMPORT
SIG · ESBUILD-ESM-LOADER
E
esbuild-esm-loader
web-frameworkjavascriptv0.3.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

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

register
node --import=esbuild-esm-loader/register ./entry.ts
node -r esbuild-esm-loader/register ./entry.ts
Use --import (ESM) not -r (CJS) for Node >=16.17.0
EsmLoader (default export)
import EsmLoader from 'esbuild-esm-loader'
const EsmLoader = require('esbuild-esm-loader')
Package is ESM-only; CJS require will fail
load hook
import { load } from 'esbuild-esm-loader'
Named export for use in custom chain; available since v0.2.0

Shows how to use the loader via --import flag to transform TSX file on the fly with ESBuild.

// file: index.tsx import React from 'react'; import { renderToStaticMarkup } from 'react-dom/server'; console.log(renderToStaticMarkup(<div>Hello World!</div>)); // Run: node --import=esbuild-esm-loader/register --enable-source-maps index.tsx
Debug
Known issues
breakingIn v0.x minor versions always include breaking changes. Expect breaking changes on minor bumps.
fix
Lock to patch version or pin with exact version.
affects: <1.0
deprecatedNode --experimental-loader is deprecated; use --import instead.
fix
Use --import=esbuild-esm-loader/register instead of --experimental-loader.
affects: >=0.2.0
gotchaLoader hooks are experimental in Node.js (still not stable as of Node 22). Integration with other loaders may break.
fix
Use only one ESM loader at a time unless chaining is supported.
affects: >=0.1.0
gotchaESBuild must be installed separately as a peer dependency. Missing esbuild causes runtime error.
fix
Run npm install esbuild alongside esbuild-esm-loader.
affects: >=0.1.0
Errors
Common errors & fixes
Cannot find module 'esbuild'
ESBuild peer dependency not installed.
fix
npm install esbuild
Error [ERR_REQUIRE_ESM]: require() of ES Module ... not supported
Trying to use require() on this ESM-only package.
fix
Use import syntax or switch to dynamic import.
ExperimentalWarning: Customization hooks is an experimental feature
Node.js warning when using loader hooks (always shown until hooks are stable).
fix
Suppress with --no-warnings, but ignore as non-critical.
Upgrade
Version history
0.3.3latest on npm
Audit
Dependencies
esbuildrequiredpeer dependency required for transformation
Agent activity
5 hits · last 30 days
node
4
OpenAI (training)
1
Resources
esbuild-esm-loader — npm install esbuild-esm-loader · libregistry