Registry / devops / vite-plugin-elm

vite-plugin-elm

JSON →
library3.0.1jsnpmunverified

Seamlessly integrate Elm into Vite projects. Current stable version is 3.0.1, with pre-releases up to 3.1.0-2. This plugin compiles .elm files during Vite's build and dev server, supporting HMR. Key differentiators: minimal configuration, supports Elm’s default compiler and custom via node-elm-compiler. ESM-only since v3, requiring Vite 5+. Active development with occasional pre-releases.

npm install vite-plugin-elm
INSTALL
IMPORT
SIG · VITE-PLUGIN-ELM
V
vite-plugin-elm
devopsjavascriptv3.0.1
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.

elm
import elm from 'vite-plugin-elm'
const elm = require('vite-plugin-elm')
Default export. Since v3, package is ESM-only, so require() fails.
default
import elm from 'vite-plugin-elm'
import { elm } from 'vite-plugin-elm'
The plugin is a default export, not a named export. Named import will be undefined.
vite-plugin-elm
import elm from 'vite-plugin-elm'
import ElmPlugin from 'vite-plugin-elm'
Any name works for default import, but elm is conventional.

Sets up Vite to compile Elm files using vite-plugin-elm. Import the default export and add it to the plugins array.

// vite.config.js import { defineConfig } from 'vite'; import elm from 'vite-plugin-elm'; export default defineConfig({ plugins: [elm()] });
Debug
Known issues
breakingvite-plugin-elm v3 drops support for Vite 2, 3, and 4. Only Vite 5+ is supported.
fix
Upgrade Vite to >=5.0.0, see https://vitejs.dev/guide/migration.html
affects: >=3.0.0
breakingvite-plugin-elm v3 is ESM-only. No CommonJS build is provided.
fix
Set "type": "module" in package.json or use .mjs extension for config files. Do not use require().
affects: >=3.0.0
gotchaThe plugin expects an Elm compiler to be installed (via npm or globally). If missing, the plugin will fail silently or produce empty output.
fix
Install elm as a dev dependency: npm install -D elm
affects: *
Errors
Common errors & fixes
Cannot find module 'vite-plugin-elm'
Package not installed or import path incorrect.
fix
Run npm install -D vite-plugin-elm and ensure import statement uses default import.
require() of ES Module not supported
Using CommonJS require() on an ESM-only package.
fix
Switch to import syntax, or set "type": "module" in package.json.
Upgrade
Version history
3.0.1latest on npm
Audit
Dependencies
viterequiredpeer dependency, requires >= 5.0.0
Agent activity
2 hits · last 30 days
node
2
Resources
vite-plugin-elm — npm install vite-plugin-elm · libregistry