Skip to content

Commit

Permalink
Merge branch 'patch-1' into shorthand-load-all-plop-assets
Browse files Browse the repository at this point in the history
  • Loading branch information
crutchcorn committed Apr 27, 2022
2 parents 5eae5d1 + 0375e40 commit f5522e0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/plop/plop-load.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ plop.load
`config` is an object that can be passed to the plopfile or `plop-pack` when they are run. This allows the consumer of the plopfile or `plop-pack` to configure certain aspects of its functionality. To know what properties should be in this object, see the documentation provided by the author.

#### include
- **type:** `Object`
- **type:** `Object` or `Boolean`
- **default:** `{ generators:true, helpers:false, partials:false, actionTypes:false }`
- **optional**

`include` is an object that can contain 4 properties (`generators`, `helpers`, `partials`, and `actionTypes`). Each of these properties should have an [`IncludeDefinition`](#IncludeDefinition) as its value. Most of the time this object is not needed because the plopfile or `plop-pack` is able to specify a default [`IncludeDefinition`](#IncludeDefinition) to be used.
If `include` is `true` all assets from the target will be included (none if `false`). Otherwise, `include` should be an object that can contain 4 properties (`generators`, `helpers`, `partials`, and `actionTypes`). Each of these properties should have an [`IncludeDefinition`](#Interface-IncludeDefinition) as its value. Most of the time this object is not needed because the plopfile or `plop-pack` is able to specify a default [`IncludeDefinition`](#Interface-IncludeDefinition) to be used.

#### Interface `IncludeDefinition`
- **Boolean:** `true` will include all assets, `false` will include non of them.
Expand All @@ -35,6 +35,11 @@ plop.load
// loads all 5 generators, no helpers, actionTypes or partials (even if they exist)
plop.load('./plopfiles/component.js');
```
*load all assets from a path*
```javascript
// loads all 5 generators, all helpers, actionTypes and partials (if they exist)
plop.load('./plopfiles/component.js', {}, true);
```
*load via a path with a custom include config*
```javascript
// loads all helpers, no generators, actionTypes or partials (even if they exist)
Expand Down

0 comments on commit f5522e0

Please sign in to comment.