Skip to main content

Elm filter for webassets

Project description

Travis CI Covearge Status Latest release Python versions License

Elm filter for webassets

Filter for compiling Elm files using webassets.


pip install webassets-elm

As of version 0.2.0, this plugin requires Elm 0.19 or newer (building with elm make).

If you need to build your Elm project with elm-make (Elm 0.18 and older), you can pin your webassets-elm package to version 0.1.7.

Basic usage

from webassets.filter import register_filter
from webassets_elm import Elm



Optionally as an evironment variable you can have:

  • ELM_BIN: alternative path to elm if it is not available globally (e.g. node_modules/.bin/elm).
  • ELM_OPTIMIZE: enable the Elm compiler optimization option. Recommended for production output.
  • ELM_DEBUG: enable the Elm compiler debug option.


Flask with flask-assets
from flask import Flask
from flask_assets import Bundle, Environment
from webassets.filter import register_filter
from webassets_elm import Elm

app = Flask(__name__)

assets = Environment(app)

elm_js = Bundle('elm/main.elm', filters=('elm',), output='app.js')
assets.register('elm_js', elm_js)
Django with django-assets
from django_assets import Bundle, register
from webassets.filter import register_filter
from webassets_elm import Elm


elm_js = Bundle('elm/main.elm', filters=('elm',), output='app.js')
register('elm_js', elm_js)


Feel free to report an issue, open a pull request, or drop a line.

Don’t forget to write and run tests, and format code with Black:

python test
black .

Please note you need elm binary available to run tests, here you can find different ways to install Elm.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for webassets-elm, version 0.2.1
Filename, size File type Python version Upload date Hashes
Filename, size webassets_elm-0.2.1-py3-none-any.whl (4.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size webassets-elm-0.2.1.tar.gz (3.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page