Registry / devops / gulp-elm

gulp-elm

JSON →
library0.8.2jsnpmunverified

Gulp plugin to compile Elm files using the Elm compiler. Version 0.8.2 supports Elm 0.19 only; earlier versions (0.7.x) support Elm 0.18. The plugin wraps Vinyl streams, providing `elm.make()` for single files and `elm.bundle()` for multiple entry files. Key options include `optimize`, `debug`, `cwd`, and custom `elm` binary path. Differentiators: simple integration with Gulp, bundle mode, and support for `--optimize` and `--debug` flags. Release cadence is sporadic, last updated in 2019.

npm install gulp-elm
INSTALL
IMPORT
SIG · GULP-ELM
G
gulp-elm
devopsjavascriptv0.8.2
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
import elm from 'gulp-elm'
const elm = require('gulp-elm')
Default import returns an object with `make` and `bundle` methods. CommonJS require works but ESM is preferred.
make
import { make } from 'gulp-elm'
const make = require('gulp-elm').make
Named export for the compile function.
bundle
import { bundle } from 'gulp-elm'
Named export for the bundling function.

Shows basic usage of elm.make() and elm.bundle() with Gulp, including optimize option.

import gulp from 'gulp'; import elm from 'gulp-elm'; gulp.task('elm', () => { return gulp.src('src/Main.elm') .pipe(elm.make({ optimize: true })) .pipe(gulp.dest('dist/')); }); gulp.task('elm-bundle', () => { return gulp.src('src/**/Main.elm') .pipe(elm.bundle('bundle.js', { optimize: true })) .pipe(gulp.dest('dist/')); });
Debug
Known issues
breakingVersion 0.8.0 drops support for Elm 0.18 and earlier; use 0.7.x for those versions.
fix
For Elm 0.18, install gulp-elm@0.7.3.
affects: >=0.8.0
gotchaThe `cwd` option must point to the directory containing elm.json, not the source files.
fix
Set cwd to the project root, e.g., { cwd: './src' } if elm.json is there.
affects: >=0.7.0
deprecatedThe `warn` option was removed in version 0.8.0.
fix
Use elm-make's native warning output; warnings appear on stderr.
affects: >=0.8.0
gotchaUsing `elm()` without specifying `make` or `bundle` is deprecated; use `elm.make()` explicitly.
fix
Always call elm.make() or elm.bundle() directly.
affects: >=0.8.0
breakingError messages changed format in 0.8.2; parsing errors may differ.
fix
Do not rely on exact error string formatting; check for error existence.
affects: >=0.8.2
Errors
Common errors & fixes
Error: elm-make exited with code 1
Elm compilation error, possibly due to missing dependencies or syntax errors.
fix
Run `elm make` manually to see full error output, or check elm.json and source files.
TypeError: elm is not a function
Misunderstanding default import: using elm() instead of elm.make() or elm.bundle().
fix
Use elm.make(options) or elm.bundle(output, options) directly.
Cannot find module 'gulp-elm'
Package not installed or missing in node_modules.
fix
Run `npm install gulp-elm --save-dev`.
The output file must be a string for elm.bundle()
Missing or invalid output file argument to bundle.
fix
Pass a string as the first argument: elm.bundle('output.js', options).
Upgrade
Version history
0.8.2latest on npm
Audit
Dependencies
vinylrequiredVinyl file abstraction used for Gulp streams
through2requiredStream transformation
Agent activity
6 hits · last 30 days
node
6
Resources
gulp-elm — npm install gulp-elm · libregistry