Elm loader for webpack
Compile Elm files using the awesome node-elm-compiler.
Installation
$ npm install --save ulmus-loader
Usage
In your webpack.config.js
file:
moduleexports = module: preLoaders: test: /\.elm$/ exclude: /node_modules/ loader: 'expose?Elm!exports?Elm!ulmus?output=tmp/[name].js' ulmus: // You can also specify the output name or pattern here. output: 'tmp/[name].js' // Set `emitErrors` to `true` to display warnings as errors. emitErrors: true ;
Filename templates
You can configure a custom filename template for your file using the query
parameter output
. For instance, to copy a file from your context
directory
into the output directory retaining the full directory structure, you might
use ?output=[path][name].js
in the query, or add this to your options:
ulmus: output: 'tmp/[path][name].js'
The default is tmp/[name].js
.
Filename template placeholders
[ext]
the extension of the resource[name]
the basename of the resource[path]
the path of the resource relative to thecontext
query parameter or option.[hash]
the hash or the content[<hashType>:hash:<digestType>:<length>]
optionally you can configure- other
hashType
s, i. e.sha1
,md5
,sha256
,sha512
- other
digestType
s, i. e.hex
,base26
,base32
,base36
,base49
,base52
,base58
,base62
,base64
- and
length
the length in chars
- other
[N]
the N-th match obtained from matching the current file name against the query paramregExp
Meta
- Code:
git clone git://github.com/unindented/ulmus-loader.git
- Home: https://github.com/unindented/ulmus-loader/
Contributors
- Daniel Perez Alvarez (unindented@gmail.com)
License
Copyright (c) 2015 Daniel Perez Alvarez (unindented.org). This is free software, and may be redistributed under the terms specified in the LICENSE file.