Registry / devops / esbuild-plugin-twiggle

esbuild-plugin-twiggle

JSON →
library1.6.9jsnpmunverified

An esbuild plugin that integrates the Twiggle JSX transformation, enabling reactive JSX syntax in your build pipeline. Current stable version is 1.6.9. It ships with TypeScript types, supports both ESM and CommonJS, and is actively maintained. Key differentiators: focuses specifically on Twiggle's reactive model, lightweight, and seamless esbuild integration.

npm install esbuild-plugin-twiggle
INSTALL
IMPORT
SIG · ESBUILD-PLUGIN-TWI
E
esbuild-plugin-twiggle
devopsjavascriptv1.6.9
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.

twigglePlugin
import twigglePlugin from 'esbuild-plugin-twiggle'
const twigglePlugin = require('esbuild-plugin-twiggle')
Default import; CommonJS require is not supported as the package is ESM-only since v1.6.0.
twigglePlugin
const esbuild = require('esbuild'); const twigglePlugin = require('esbuild-plugin-twiggle').default;
const twigglePlugin = require('esbuild-plugin-twiggle')
In CJS context, access the default export via .default.
TwiggleConfig
import { TwiggleConfig } from 'esbuild-plugin-twiggle'
import TwiggleConfig from 'esbuild-plugin-twiggle'
TypeScript type export for configuration interface; named import required.

Demonstrates basic esbuild setup with the Twiggle plugin to transform JSX files.

import esbuild from 'esbuild'; import twigglePlugin from 'esbuild-plugin-twiggle'; await esbuild.build({ entryPoints: ['src/index.tsx'], bundle: true, outfile: 'dist/bundle.js', plugins: [twigglePlugin()], }); console.log('Build complete!');
Debug
Known issues
breakingSwitched from CommonJS to ESM-only in v1.6.0. Requires 'type': 'module' in package.json or .mjs extension.
fix
Update your project to use ESM: set 'type': 'module' in package.json or rename files to .mjs.
affects: >=1.6.0
gotchaPlugin requires esbuild >=0.17.0 to function correctly.
fix
Verify your esbuild version with 'npm list esbuild' and upgrade if needed: npm install esbuild@latest
affects: >=1.0.0
gotchaTwiggle JSX syntax must be enabled in your tsconfig.json (jsx: 'react-jsx' or similar).
fix
Set 'jsx': 'react-jsx' in tsconfig.json compilerOptions.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'esbuild-plugin-twiggle'
Package not installed or not in node_modules.
fix
Run npm install esbuild-plugin-twiggle
TypeError: twigglePlugin is not a function
Incorrect import: using CJS require without .default.
fix
Use import twigglePlugin from 'esbuild-plugin-twiggle' or const twigglePlugin = require('esbuild-plugin-twiggle').default;
Upgrade
Version history
1.6.9latest on npm
Audit
Dependencies
esbuildrequiredpeer dependency; required at runtime to register the plugin
Agent activity
2 hits · last 30 days
node
2
Resources
esbuild-plugin-twiggle — npm install esbuild-plugin-twiggle · libregistry