{"id":21238,"library":"esbuild-plugin-elm","title":"esbuild-plugin-elm","description":"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.","status":"active","version":"0.0.12","language":"javascript","source_language":"en","source_url":"https://github.com/phenax/esbuild-plugin-elm","tags":["javascript"],"install":[{"cmd":"npm install esbuild-plugin-elm","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-plugin-elm","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-plugin-elm","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; plugin works with esbuild >=0.8.1","package":"esbuild","optional":false}],"imports":[{"note":"Default export; named export not available in CommonJS","wrong":"const { ElmPlugin } = require('esbuild-plugin-elm')","symbol":"ElmPlugin","correct":"import ElmPlugin from 'esbuild-plugin-elm'"},{"note":"CommonJS require needs .default due to ESM default export","wrong":"const ElmPlugin = require('esbuild-plugin-elm')","symbol":"ElmPlugin","correct":"const ElmPlugin = require('esbuild-plugin-elm').default"},{"note":"Named import is incorrect; it's a default export","wrong":"import { ElmPlugin } from 'esbuild-plugin-elm'","symbol":"ElmPlugin","correct":"import ElmPlugin from 'esbuild-plugin-elm'"}],"quickstart":{"code":"import esbuild from 'esbuild';\nimport ElmPlugin from 'esbuild-plugin-elm';\n\nawait esbuild.build({\n  entryPoints: ['src/index.js'],\n  bundle: true,\n  outfile: 'dist/bundle.js',\n  plugins: [\n    ElmPlugin({\n      debug: false,\n      optimize: process.env.NODE_ENV === 'production',\n      pathToElm: 'node_modules/.bin/elm',\n      clearOnWatch: false,\n      verbose: false,\n    }),\n  ],\n});\nconsole.log('Build complete.');","lang":"javascript","description":"Basic ESM usage of esbuild-plugin-elm with esbuild, showing import and configuration options."},"warnings":[{"fix":"Use default import: import ElmPlugin from 'esbuild-plugin-elm'","message":"Default export; named import fails","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use const ElmPlugin = require('esbuild-plugin-elm').default","message":"CommonJS require returns ESM module; must use .default","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Set pathToElm option to exact path of elm binary (e.g., require('elm'))","message":"Path to Elm executable defaults to 'elm' in PATH; may fail if not installed globally","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'0.0.12':13 '0.8.1':79 '2022':87 'altern':55 'base':37 'build':9,22,74 'cadenc':81 'clear':46 'compar':53 'compil':18 'consol':45 'coupl':69 'custom':48 'debug':34 'depend':76 'directori':30 'elm':4,10,17,51,58,63 'elm-parcel':62 'elm-webpack-load':57 'elm.json':27 'env':40 'esbuild':2,6,20,71,78 'esbuild-plugin-elm':1 'execut':52 'faster':73 'featur':32 'import':25 'includ':33 'integr':15 'irregular':83 'javascript':88 'key':31 'last':84 'like':56 'loader':60 'mode':35,42 'node':39 'offer':72 'optim':36 'parcel':64 'path':49 'plugin':3,7,66 'process':23 'project':11 'releas':80 'resolv':24 'sourc':29 'source-directori':28 'support':43 'tight':68 'updat':85 'version':12 'via':26 'watch':41 'webpack':59","created_at":"2026-04-27T16:58:51.739948+00:00","updated_at":"2026-04-27T16:58:51.739948+00:00","problems":[{"fix":"const ElmPlugin = require('esbuild-plugin-elm').default","cause":"Incorrect import: const ElmPlugin = require('esbuild-plugin-elm') instead of .default","error":"TypeError: ElmPlugin is not a function"},{"fix":"Install elm globally or set pathToElm option to full path of elm executable","cause":"Elm compiler not installed or not in PATH","error":"Error: Plugin 'elm' failed: elm: command not found"},{"fix":"Use a JavaScript/TypeScript file as entry point that imports Elm modules","cause":"Entry point file extension not recognized; use .js or .ts as entry, not .elm","error":"error: No matching entry point found for 'src/Main.elm'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/phenax/esbuild-plugin-elm","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/esbuild-plugin-elm","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","web-framework","http-networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-18","next_check":"2026-07-26","install_tag":null}}