Skip to content

Commit

Permalink
docs: update generate option signature. supercedes #182
Browse files Browse the repository at this point in the history
  • Loading branch information
shellscape committed Oct 25, 2020
1 parent 6a9b65f commit 7bafd43
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,21 @@ Specifies the file name to use for the resulting manifest. By default the plugin
Type: `Function`<br>
Default: `undefined`

Allows filtering the files which make up the manifest. The passed function should match the signature of `(FileDescriptor) => Boolean`. Return `true` to keep the file, `false` to remove the file.
Allows filtering the files which make up the manifest. The passed function should match the signature of `(file: FileDescriptor) => Boolean`. Return `true` to keep the file, `false` to remove the file.

### `generate`

Type: `Function(seed, files, entrypoints): => Object`<br>
Parameter Types: `(Object, FileDescriptor, string[])`<br>
Type: `Function`<br>
Default: `undefined`

A custom `Function` to create the manifest. It can return anything as long as it's serialisable by `JSON.stringify`.
A custom `Function` to create the manifest. The passed function should match the signature of `(seed: Object, files: FileDescriptor[], entries: string[]) => Object` and can return anything as long as it's serialisable by `JSON.stringify`.

### `map`

Type: `Function`<br>
Default: `undefined`

Allows modifying the files which make up the manifest. The passed function should match the signature of `(FileDescriptor) => FileDescriptor` where an object matching `FileDescriptor` is returned.
Allows modifying the files which make up the manifest. The passed function should match the signature of `(file: FileDescriptor) => FileDescriptor` where an object matching `FileDescriptor` is returned.

### `publicPath`

Expand Down Expand Up @@ -136,7 +135,7 @@ A `Function` which can be leveraged to serialize the manifest in a different for
Type: `Function`<br>
Default: `undefined`

Allows sorting the files which make up the manifest. The passed function should match the signature of `(FileDescriptor, FileDescriptor) => Number`. Return `0` to indicate no change, `-1` to indicate the file should be moved to a lower index, and `1` to indicate the file shoud be moved to a higher index.
Allows sorting the files which make up the manifest. The passed function should match the signature of `(fileA: FileDescriptor, fileB: FileDescriptor) => Number`. Return `0` to indicate no change, `-1` to indicate the file should be moved to a lower index, and `1` to indicate the file shoud be moved to a higher index.

### `writeToFileEmit`

Expand Down

0 comments on commit 7bafd43

Please sign in to comment.