Filter for compiling Elm files using webassets.
The elm-make
binary has to be available from your system path. If it is not available you can:
- Configure an alternative path to
elm-make
with theELM_MAKE_BIN
variable (e.g.node_modules/.bin/elm-make
) - Install it globally using
$ npm i -g elm
or with any of these methods
python -m pip webassets-elm
from webassets.filter import register_filter
from webassets_elm import Elm
register_filter(Elm)
Using 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',
depends='**/*.elm')
assets.register('elm_js', elm_js)
Using 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',
depends='**/*.elm')
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:
python setup.py test
You need elm
binaries available to run the tests. Install Elm and then the required packeges packages:
elm-package install
Copyright (c) 2016 Eduardo Cuducos
Licensed under the MIT License.