mako
A pluggable general-purpose build tool
Last updated 3 years ago by dominicbarnes .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install mako 
SYNC missed versions from official npm registry.

mako (aka: core)

The coordinator for mako builds.

npm version npm dependencies npm dev dependencies

API

mako([options])

Returns a new Runner instance, no need for the new keyword.

Available options:

  • root the project root (default: pwd)
  • plugins a list of plugins to add during init
  • tree a predefined tree (eg: loading from mako-cache)
  • concurrency used internally to set parallel concurrency limits

mako.Runner

The Runner class is exposed publicly to allow for advanced extensions.

runner.use(...plugins) (chainable)

Adds a new plugin to the runner. Each plugin is a Function, so any nested arrays will be flattened, allowing you to nest freely. (particularly useful for bundles)

runner.build(...entries)

The primary public interface, which runs both parse and compile for the given entries. It returns a Promise that resolves with a Build object that contains some information about the build itself.

runner.parse(...entries)

Runs parse for the passed entries. This method isn't typically used directly, but it can be useful for priming the tree for doing watches or inspecting the dependency tree.

It returns a Promise that resolves with a Build object.

runner.compile(...entries)

Runs compile for the given entries, this will skip the parse phase in case you know it has already been finished. (such as when calling runner.parse() manually)

It returns a Promise that resolves with a Build object.

runner.{hook}(extensions, handler)

Registers a handler for a specific hook, see the wiki for more information. There is a different method for each of the available hooks.

Build

This object is returned from each call to build/parse/compile, and it is shared by plugins throughout the build for holding the current tree, tracking timing and interacting with the core runner.

Described below is the public API primarily for end-users, but it is not exposed publicly at this time. Plugin authors should refer to the wiki for more information about plugin-specific APIs.

build.entries

This is an array of the entry files that were triggered for this build.

build.tree

This is a reference to the tree in use during the current phase.

If returned from runner.parse(), it will be a reference to runner.tree, so don't modify this tree unless you know exactly what you're doing.

If returned from either runner.compile() or runner.build(), this will be the same tree used during the compile phase. This tree is safe to modify, but it won't do anything, since the build is already complete.

build.runner

A reference to the runner that initiated this build.

Current Tags

  • 1.1.7                                ...           latest (3 years ago)

66 Versions

  • 1.1.7                                ...           3 years ago
  • 1.1.6                                ...           4 years ago
  • 1.1.5                                ...           4 years ago
  • 1.1.4                                ...           4 years ago
  • 1.1.3                                ...           4 years ago
  • 1.1.2                                ...           4 years ago
  • 1.1.1                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
  • 0.13.3                                ...           4 years ago
  • 0.13.2                                ...           4 years ago
  • 0.13.1                                ...           4 years ago
  • 0.13.0                                ...           4 years ago
  • 0.12.20                                ...           4 years ago
  • 0.12.18                                ...           4 years ago
  • 0.12.17                                ...           4 years ago
  • 0.12.16                                ...           4 years ago
  • 0.12.15                                ...           4 years ago
  • 0.12.14                                ...           4 years ago
  • 0.12.12                                ...           4 years ago
  • 0.12.11                                ...           4 years ago
  • 0.12.10                                ...           4 years ago
  • 0.12.8                                ...           4 years ago
  • 0.12.7                                ...           4 years ago
  • 0.12.6                                ...           4 years ago
  • 0.12.5                                ...           4 years ago
  • 0.12.4                                ...           4 years ago
  • 0.12.3                                ...           4 years ago
  • 0.12.2                                ...           4 years ago
  • 0.12.1                                ...           4 years ago
  • 0.12.0                                ...           4 years ago
  • 0.11.1                                ...           4 years ago
  • 0.11.0                                ...           4 years ago
  • 0.10.0                                ...           4 years ago
  • 0.9.2                                ...           4 years ago
  • 0.9.1                                ...           4 years ago
  • 0.9.0                                ...           4 years ago
  • 0.8.4                                ...           4 years ago
  • 0.8.3                                ...           4 years ago
  • 0.8.2                                ...           4 years ago
  • 0.8.1                                ...           4 years ago
  • 0.8.0                                ...           4 years ago
  • 0.7.4                                ...           5 years ago
  • 0.7.3                                ...           5 years ago
  • 0.7.2                                ...           5 years ago
  • 0.7.1                                ...           5 years ago
  • 0.7.0                                ...           5 years ago
  • 0.6.2                                ...           5 years ago
  • 0.6.1                                ...           5 years ago
  • 0.6.0                                ...           5 years ago
  • 0.5.1                                ...           5 years ago
  • 0.5.0                                ...           5 years ago
  • 0.4.3                                ...           5 years ago
  • 0.4.2                                ...           5 years ago
  • 0.4.1                                ...           5 years ago
  • 0.4.0                                ...           5 years ago
  • 0.3.2                                ...           5 years ago
  • 0.3.1                                ...           5 years ago
  • 0.3.0                                ...           5 years ago
  • 0.2.1                                ...           5 years ago
  • 0.2.0                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
  • 0.0.4                                ...           5 years ago
  • 0.0.3                                ...           5 years ago
  • 0.0.2                                ...           5 years ago
  • 0.0.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (8)
Dev Dependencies (0)
None

Copyright 2014 - 2016 © taobao.org |