Skip to content
This repository has been archived by the owner on Mar 27, 2020. It is now read-only.

Add prepend config option #16

Merged
merged 1 commit into from
Apr 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ config:
- another-excluded-func
```

#### `prepend` (optional)

Whether or not to prepend the IOpipe layer. Defaults to `false` which appends the layer.

```yaml
config:
iopipe:
prepend: true
```


## Supported Runtimes

Expand Down
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ export default class IOpipeLayerPlugin {
`Function "${funcName}" already specifies an IOpipe layer; skipping.`
);
} else {
layers.push(layerArn);
if (typeof this.config.prepend === "boolean" && this.config.prepend) {
layers.unshift(layerArn);
} else {
layers.push(layerArn);
}
funcDef.layers = layers;
}

Expand Down