📦Filter for compiling Elm files using webassets
Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
webassets_elm
.gitignore
.landscape.yml
.travis.yml
CHANGELOG
LICENSE
README.rst
elm-package.json
setup.py
tox.ini

README.rst

Elm filter for webassets

Travis CI Covearge Code Health

Filter for compiling Elm files using webassets.

Status Latest release Python versions License

Install

pip install webassets-elm

Basic usage

from webassets.filter import register_filter
from webassets_elm import Elm

register_filter(Elm)

Settings

Optionally as an evironment variable you can have:

  • ELM_MAKE_BIN: alternative path to elm-make if it is not available globally (e.g. node_modules/.bin/elm-make)
  • ELM_MAKE_CHANGE_DIRECTORY: if set the filter will switch to source_path directory (where the main .elm is located) prior to compilation

Examples

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__)

register_filter(Elm)
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

register_filter(Elm)

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

Contributing

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

Don't forget to write and run tests:

python setup.py test

You need elm binaries available to run tests. Install Elm and then the required packages:

elm-package install