Registry / devops / electron-esbuild-17x

electron-esbuild-17x

JSON →
library7.0.4jsnpmunverified

CLI tool for integrating esbuild with Electron, providing fast compilation and HMR for renderer processes. Current stable version is 7.0.4 (peer deps: esbuild@0.16.x, vite@4.x). Active development with major breaking changes between versions: v6 removed webpack support, v7 upgraded to vite@4, v8 requires node@18.15 and esbuild@0.18, v9 is pure ESM, v10 supports electron@36 and vite@6. Release cadence is roughly quarterly. Key differentiator: opinionated zero-config setup for Electron + esbuild + Vite, with HMR out of the box.

npm install electron-esbuild-17x
INSTALL
IMPORT
SIG · ELECTRON-ESBUILD-1
E
electron-esbuild-17x
devopsjavascriptv7.0.4
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.

default export
import electronESBuild from 'electron-esbuild'
const electronESBuild = require('electron-esbuild')
Package is CLI-only since v9 (pure ESM); no default export available in latest versions. Use the CLI commands directly.
createApp
import { createApp } from '@electron-esbuild/create-app'
const createApp = require('@electron-esbuild/create-app')
Scoped package for scaffolding; ESM-only since v9.
dev
import { dev } from 'electron-esbuild/cli'
const dev = require('electron-esbuild/cli').dev
Internal CLI exports; prefer running `electron-esbuild dev` from command line.

Scaffolds a new Electron project with esbuild and Vite, then starts development with HMR.

npm init @electron-esbuild/app my-app cd my-app npm run dev
electron-esbuild-17x --version
Debug
Known issues
breakingv6.0.0 removed webpack support—use Vite instead.
fix
Migrate to Vite configuration; run `npm init @electron-esbuild/app` to generate new project skeleton.
affects: >=6.0.0
breakingv7.0.0 requires vite@4; existing projects must update Vite config.
fix
Update vite.config.ts/js to use Vite 4 syntax (e.g., server.port).
affects: >=7.0.0
breakingv8.0.0 requires node@18.15.0 and esbuild@0.18.
fix
Upgrade Node and esbuild to meet version requirements.
affects: >=8.0.0
breakingv9.0.0 switched to pure ESM; CommonJS `require()` will fail.
fix
Use `import` syntax or set `type: 'module'` in package.json.
affects: >=9.0.0
breakingv10.0.0 requires electron@36 and vite@6.
fix
Update electron and vite to compatible versions.
affects: >=10.0.0
gotchaCLI arguments after `--` are passed to the electron process, not to electron-esbuild itself.
fix
Place flags for electron after `--`, e.g., `electron-esbuild dev -- --inspect`.
affects: *
gotchaDefault Vite port changed from 9080 (v6) to 5173 (v7+); existing projects may break.
fix
Set `server.port` in vite.config.ts/js explicitly or update project to use port 5173.
affects: >=7.0.0
Errors
Common errors & fixes
Error: electron-esbuild is not recognized as an internal or external command
Package not installed globally or not in PATH.
fix
Run `npx electron-esbuild dev` or install locally `npm install --save-dev electron-esbuild` and use npm scripts.
SyntaxError: Cannot use import statement outside a module
Trying to use ESM import in a CommonJS project (applies to v9+).
fix
Set `"type": "module"` in package.json or rename file to .mjs.
Error: Cannot find module 'vite'
Peer dependency vite is not installed.
fix
Run `npm install vite@4` (or compatible version per electron-esbuild version).
Error: The port was already in use
Default Vite port 5173 is occupied by another process (or port 9080 in v6).
fix
Set a custom port in vite.config.ts: `server: { port: 3000 }`.
Upgrade
Version history
7.0.4latest on npm
Audit
Dependencies
esbuildrequiredBundler for main process and renderer
viterequiredDev server and build tool for renderer
Agent activity
2 hits · last 30 days
node
2
Resources
electron-esbuild-17x — npm install electron-esbuild-17x · libregistry