Compile Elm files using the awesome node-elm-compiler.
$ npm install --save ulmus-loader
In your webpack.config.js
file:
module.exports = {
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
}
};
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
.
[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
- Code:
git clone git://github.com/unindented/ulmus-loader.git
- Home: https://github.com/unindented/ulmus-loader/
- Daniel Perez Alvarez (unindented@gmail.com)
Copyright (c) 2015 Daniel Perez Alvarez (unindented.org). This is free software, and may be redistributed under the terms specified in the LICENSE file.