node package manager

fly

Modern Build System

fly

Node.js build system based in generators.

Features

See the documentation to learn more.

Install

npm install fly

flyfile.js

ES5

Out of the box, a flyfile.js should be written in native ES5:

var x = module.exports
var paths = {
  scripts: ['src/**/*.js', '!src/ignore/**/*.js']
}
 
x.default = function * () {
  yield this.watch(paths.scripts, 'build')
}
 
x.build = function * () {
  yield this.source(paths.scripts)
    .eslint({
      rules: {'no-extra-semi': 0}
    })
 
  yield this.source(paths.scripts)
    .babel({
      presets: ['es2015', 'stage-0']
    })
    .concat('app.js')
    .target('dist')
}

ES2015 and beyond

If you'd prefer to write your flyfile.js and plugins with ES6 or ES7 syntax, install fly-esnext and that's it :)

npm i -D fly-esnext
const paths = {
  scripts: ['src/**/*.js', '!src/ignore/**/*.js']
}
 
export default async function () {
  await this.watch(paths.scripts, 'build')
}
 
export async function build() {
  await this.source(paths.scripts)
    .eslint({
      rules: {'no-extra-semi': 0}
    })
 
  await this.source(paths.scripts)
    .babel({
      presets: ['es2015', 'stage-0']
    })
    .concat('app.js')
    .target('dist')
}