fly-earl
Version:
Fly plugin for Earl Grey
81 lines (63 loc) • 2.58 kB
Markdown
<div align="center">
<a href="http://github.com/flyjs/fly">
<img width=200px src="https://cloud.githubusercontent.com/assets/8317250/8733685/0be81080-2c40-11e5-98d2-c634f076ccd7.png">
</a>
</div>
> [Earl Grey](https://breuleux.github.io/earl-grey/) plugin for _[Fly][fly]_.
[![][fly-badge]][fly]
[![npm package][npm-ver-link]][releases]
[![][dl-badge]][npm-pkg-link]
[![][travis-badge]][travis-link]
[![][mit-badge]][mit]
```js
yield this.source(glob).earl([opts]).target(outputDir)
```
`opts.es5` is a boolean option to change compilation to ES5. Defaults to false.
`opts.sourceMaps` is a string that specifies how to handle sourcemaps. `.compute` will compute sourcemaps but does not place `sourceMappingURL` within the file. `.inline` does add it. The default is null.
`opts.runtime` is a string that specifies which runtime to require. If null, no runtime is used and this removes some boilerplate code. This defaults to requiring `earlgrey-runtime`.
`opts.parameters` is an object containing flags that you can pass right into your programs to be accessed by macros via `@getopt("flagName")`. Flags are not limited to booleans and can be any arbitray data. For example:
```earl-grey
parameters = {
debug-level = .critical
test-data = {"Pepperoni", "Cheese", "Sausage", "Peppers"}
tests = false
}
```
```
npm install -D fly-earl
```
```js
exports.build = function* () {
yield this
.source("src/**/*.eg")
.earl({ es5: true })
.target("dist/")
}
```
```earl-grey
provide: build
gen build = ->
yield chain this:
@source("src/**/*.eg")
@earl({ es5 = true })
@target("dist/")
```
[][mit] © [Jake Russo][author] et [al][contributors]
[]: http://opensource.org/licenses/MIT
[]: http://github.com/MadcapJake
[]: https://github.com/MadcapJake/fly-earl/graphs/contributors
[]: https://github.com/MadcapJake/fly-earl/releases
[]: https://www.github.com/flyjs/fly
[]: https://img.shields.io/badge/fly-JS-05B3E1.svg?style=flat-square
[]: https://img.shields.io/badge/license-MIT-444444.svg?style=flat-square
[]: https://www.npmjs.org/package/fly-earl
[]: https://img.shields.io/npm/v/fly-earl.svg?style=flat-square
[]: http://img.shields.io/npm/dm/fly-earl.svg?style=flat-square
[]: https://travis-ci.org/MadcapJake/fly-earl
[]: http://img.shields.io/travis/MadcapJake/fly-earl.svg?style=flat-square