Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
doc: Update readme with new options
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalsadhu committed Mar 8, 2018
1 parent b4788ee commit 26b313f
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ Supported arguments are:
[asset-pipe-build-server][asset-pipe-build-server]
* `options.serverId` - An optional unique name to identify the deployed server
(required for runtime optimistic bundling)
* `options.minify` - Use minification (optimistic bundling only) `true|false` Not providing this option will result in server default being used.
* `options.sourceMaps` - (experimental) Use sourceMaps (optimistic bundling only) `true|false` Not providing this option will result in server default being used.

### transform()

Expand Down Expand Up @@ -269,7 +271,7 @@ Creates an asset bundle on the
* `feeds` - Array - List of asset-feed filenames.
* `type` - string - Either 'js' or 'css'

### publishAssets(tag, entrypoints)
### publishAssets(tag, entrypoints, options)

Publishes assets to the asset server for use in optimisitic bundling. Bundles
will be created according to bundle instructions published using the
Expand All @@ -279,6 +281,7 @@ will be created according to bundle instructions published using the
unique.
* `entrypoints` - `Array` - Array of asset entrypoint filenames to be published
to the asset server.
* `options` - `object` - Bundling options. `{minify: true|false, sourceMaps: true|false}` Setting these options here will override the same options provided to the constructor

`return` - `object` - An object with keys `id` (refering to the unique asset
hash) and `uri` (referring to the location of the published asset on the
Expand All @@ -298,7 +301,15 @@ CSS
const { uri, id } = await client.publishAssets('podlet1', ['/path/to/file.css']);
```

### publishInstructions(tag, type, data)
With minification

```js
const { uri, id } = await client.publishAssets('podlet1', ['/path/to/file.js'], {
minify: true,
});
```

### publishInstructions(tag, type, data, options)

Publishes bundling instructions to the asset server for use in optimisitic
bundling. Bundles are generated as specified by the `data` array. Anytime new
Expand All @@ -311,6 +322,7 @@ instructions are published (via `publishInstructions`) or assets are published
* `data` - `array` - Array of tags to bundle together. Each tag must refer to
the tag property given when publishing assets using the `publishAssets`
method.
* `options` - `object` - Bundling options. `{minify: true|false, sourceMaps: true|false}` Setting these options here will override the same options provided to the constructor

`return` - 204 No Content is returned when publishing has successfully completed.

Expand All @@ -328,6 +340,14 @@ CSS
await client.publishInstructions('layout', 'css', ['podlet1', 'podlet2']);
```

With minification

```js
await client.publishInstructions('layout', 'js', ['podlet1', 'podlet2'], {
minify: true,
});
```

## Transpilers

Since [asset-pipe][asset-pipe] is built on [browserify][browserify] under the
Expand Down

0 comments on commit 26b313f

Please sign in to comment.