Registry / devops / esbuild-plugin-elm

esbuild-plugin-elm

JSON →
library0.0.12jsnpmunverified

An esbuild plugin for building Elm projects, version 0.0.12. It integrates the Elm compiler into esbuild's build process, resolving imports via elm.json source-directories. Key features include debug mode, optimization based on NODE_ENV, watch mode support with console clearing, and custom path to Elm executable. Compared to alternatives like elm-webpack-loader or elm-parcel, this plugin is tightly coupled with esbuild, offering faster builds. It depends on esbuild >=0.8.1. Release cadence is irregular, last updated in 2022.

npm install esbuild-plugin-elm
INSTALL
IMPORT
SIG · ESBUILD-PLUGIN-ELM
E
esbuild-plugin-elm
devopsjavascriptv0.0.12
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.

ElmPlugin
import ElmPlugin from 'esbuild-plugin-elm'
const { ElmPlugin } = require('esbuild-plugin-elm')
Default export; named export not available in CommonJS
ElmPlugin
const ElmPlugin = require('esbuild-plugin-elm').default
const ElmPlugin = require('esbuild-plugin-elm')
CommonJS require needs .default due to ESM default export
ElmPlugin
import ElmPlugin from 'esbuild-plugin-elm'
import { ElmPlugin } from 'esbuild-plugin-elm'
Named import is incorrect; it's a default export

Basic ESM usage of esbuild-plugin-elm with esbuild, showing import and configuration options.

import esbuild from 'esbuild'; import ElmPlugin from 'esbuild-plugin-elm'; await esbuild.build({ entryPoints: ['src/index.js'], bundle: true, outfile: 'dist/bundle.js', plugins: [ ElmPlugin({ debug: false, optimize: process.env.NODE_ENV === 'production', pathToElm: 'node_modules/.bin/elm', clearOnWatch: false, verbose: false, }), ], }); console.log('Build complete.');
Debug
Known issues
gotchaDefault export; named import fails
fix
Use default import: import ElmPlugin from 'esbuild-plugin-elm'
affects: >=0.0.0
gotchaCommonJS require returns ESM module; must use .default
fix
Use const ElmPlugin = require('esbuild-plugin-elm').default
affects: >=0.0.0
gotchaPath to Elm executable defaults to 'elm' in PATH; may fail if not installed globally
fix
Set pathToElm option to exact path of elm binary (e.g., require('elm'))
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: ElmPlugin is not a function
Incorrect import: const ElmPlugin = require('esbuild-plugin-elm') instead of .default
fix
const ElmPlugin = require('esbuild-plugin-elm').default
Error: Plugin 'elm' failed: elm: command not found
Elm compiler not installed or not in PATH
fix
Install elm globally or set pathToElm option to full path of elm executable
error: No matching entry point found for 'src/Main.elm'
Entry point file extension not recognized; use .js or .ts as entry, not .elm
fix
Use a JavaScript/TypeScript file as entry point that imports Elm modules
Upgrade
Version history
0.0.12latest on npm
Audit
Dependencies
esbuildrequiredPeer dependency; plugin works with esbuild >=0.8.1
Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
esbuild-plugin-elm — npm install esbuild-plugin-elm · libregistry