Skip to content
This repository has been archived by the owner on Jan 4, 2021. It is now read-only.

Commit

Permalink
improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Jul 22, 2018
1 parent 047bc50 commit 5ed4490
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/config.md
@@ -1,6 +1,6 @@
# cush.config.js

This document describes the `cush.config.js` module.
This document describes the `cush.config.js` module, which is used to configure the bundles of a project.

## `bundles` object

Expand All @@ -10,7 +10,7 @@ Each key is the path to a bundle's main module (relative to the project root).

Each value is an [options][opts] object.

[opts]: ./bundle.md#options
[opts]: ./fs.md#creating-a-bundle

```js
exports.bundles = {
Expand Down
16 changes: 14 additions & 2 deletions docs/fs.md
Expand Up @@ -21,7 +21,7 @@ The `target` is required. Common values are `web`, `ios`, and `android`.

The `plugins` option is identical to calling `Bundle#use` with the same value. [Learn more](./plugins.md#using-a-plugin)

The `parsers` option is an array of filenames that are imported in all workers. [Learn more](./workers.md#hooks-parse)
The `parsers` option is an array of filenames that are imported in all workers. [Learn more](./workers.md#parseextasset-asset-pack-object)

The `format` option is explained on [this page.](./formats.md)

Expand Down Expand Up @@ -99,7 +99,7 @@ The timestamp of when the last (successful) build started.

### Methods

[Config methods](./config.md#config-methods) and [hook methods](#./hooks.md) are available.
[Config methods](./config.md#config-methods) and [hook methods](./hooks.md) are available.

These methods are also available:

Expand Down Expand Up @@ -155,6 +155,18 @@ Once this is called, you'll need to use `cush.bundle` if you need the same bundl

You *must* call this to properly clean up the worker farm and stop any file watchers.

### Hooks

Here are hooks provided by the bundler by default. Remember that plugins and bundle formats can provide their own hooks, so read their documentation too.

### `asset(asset: Asset, state: Object)`

Called on every build for every asset used by the bundle. The asset may have been in the previous build or entirely new. The `state` object is equivalent to `asset.owner.bundle.state`, which is reset at the start of every build.

### `package(pack: Package, state: Object)`

The same as the `asset` hook, but for packages. This hook is called before the `asset` hook when an asset new to the bundle is owned by a package new to the bundle.

 

## `Package` class
Expand Down

0 comments on commit 5ed4490

Please sign in to comment.