{"id":25449,"library":"esbuild-solid","title":"esbuild-solid","description":"esbuild-solid is an ESBuild plugin (version 0.6.0, last updated May 2024) that compiles Solid JSX components using Babel under the hood. It automatically detects JSX syntax in .jsx/.tsx files, transforms them with babel-preset-solid, and integrates seamlessly into esbuild's build process. Key differentiators: zero configuration, lightweight (30 lines of code), and works with both JavaScript and TypeScript. Requires esbuild ^0.8.2 and solid-js ^0.23.","status":"active","version":"0.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/amoutonbrady/esbuild-solid","tags":["javascript","solid","solid-js","esbuild","plugin","typescript"],"install":[{"cmd":"npm install esbuild-solid","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-solid","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-solid","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; provides the build tool that this plugin integrates with.","package":"esbuild","optional":false},{"reason":"Peer dependency; the Solid framework runtime required for compiled JSX.","package":"solid-js","optional":false}],"imports":[{"note":"Main export function that returns the esbuild plugin. Available as a named export. CJS users can use `const { solidPlugin } = require('esbuild-solid')` correctly, but `require('esbuild-solid')` returns an object, not a function.","wrong":"const solidPlugin = require('esbuild-solid')","symbol":"solidPlugin","correct":"import { solidPlugin } from 'esbuild-solid'"},{"note":"Package also exports a default export (the same function). In ESM, default import is valid. In CJS, require returns the module object, so you must destructure.","wrong":"const solidPlugin = require('esbuild-solid')","symbol":"default","correct":"import solidPlugin from 'esbuild-solid'"},{"note":"TypeScript types are bundled. Options type is exported for configuration, but currently there are no options (empty interface).","wrong":"import { SolidPluginOptions } from 'esbuild-solid' (if used as value)","symbol":"Type definitions","correct":"import type { SolidPluginOptions } from 'esbuild-solid'"}],"quickstart":{"code":"const { build } = require('esbuild');\nconst { solidPlugin } = require('esbuild-solid');\n\nbuild({\n  entryPoints: ['app.jsx'],\n  bundle: true,\n  outfile: 'out.js',\n  plugins: [solidPlugin()],\n}).catch(() => process.exit(1));","lang":"javascript","description":"Basic usage of esbuild-solid plugin to build a Solid JSX app with esbuild, including error handling."},"warnings":[{"fix":"Ensure all files containing JSX use .jsx or .tsx extensions; the regex checks for JSX syntax but is heuristic-based.","message":"Plugin only transforms files with JSX syntax detected via regex; files without JSX are passed through untransformed, which can lead to missing compilation if JSX is introduced dynamically.","severity":"gotcha","affected_versions":"*"},{"fix":"Consider using a more recent fork or upgrading to a maintained Solid plugin that supports Solid v1+.","message":"Peer dependencies require solid-js ^0.23, which is outdated; newer versions of Solid (>=1.0) may break.","severity":"deprecated","affected_versions":"<=0.6.0"},{"fix":"Import only from 'esbuild-solid' main entry; do not rely on subpath imports.","message":"Version 0.6.0 switched build system to unbuild; previously the package was built differently, potentially breaking direct imports of internal files.","severity":"breaking","affected_versions":">=0.6.0"},{"fix":"If you have a custom Babel setup, consider using a different plugin that allows configuration or ensure there is no conflict.","message":"The plugin uses @babel/core and babel-preset-solid under the hood, which may conflict with existing Babel configuration if present.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install @babel/core and @babel/preset-typescript as devDependencies: npm install -D @babel/core @babel/preset-typescript","cause":"The plugin requires @babel/core as a dependency but it is not installed automatically.","error":"Cannot find module '@babel/core'"},{"fix":"Update to latest version (>=0.6.0) or use default import: import solidPlugin from 'esbuild-solid'","cause":"Using an older version of the package (pre-0.6.0) that did not have named exports or had different export structure.","error":"Error: The module \"/path/to/node_modules/esbuild-solid/lib/index.js\" does not provide a named export 'solidPlugin'"},{"fix":"Add the solidPlugin() call to the plugins array: plugins: [solidPlugin()]","cause":"Forgetting to include the plugin in esbuild plugins array.","error":"error: No loader is configured for \".jsx\" files: app.jsx"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}