Skip to content

Commit 0375e40

Browse files
authored
enhancement: load all assets shorthand
Reflects the changes proposed to `node-plop` to allow all target assets to be loaded using: ```js plop.load('./plopfiles/component.js', {}, true); ``` The `node-plop` PR can be found here: plopjs/node-plop#187
1 parent 05a85cc commit 0375e40

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

plop-load.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ plop.load
1818
`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.
1919

2020
#### include
21-
- **type:** `Object`
21+
- **type:** `Object` or `Boolean`
2222
- **default:** `{ generators:true, helpers:false, partials:false, actionTypes:false }`
2323
- **optional**
2424

25-
`include` is 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.
25+
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.
2626

2727
#### Interface `IncludeDefinition`
2828
- **Boolean:** `true` will include all assets, `false` will include non of them.
@@ -35,6 +35,11 @@ plop.load
3535
// loads all 5 generators, no helpers, actionTypes or partials (even if they exist)
3636
plop.load('./plopfiles/component.js');
3737
```
38+
*load all assets from a path*
39+
```javascript
40+
// loads all 5 generators, all helpers, actionTypes and partials (if they exist)
41+
plop.load('./plopfiles/component.js', {}, true);
42+
```
3843
*load via a path with a custom include config*
3944
```javascript
4045
// loads all helpers, no generators, actionTypes or partials (even if they exist)

0 commit comments

Comments
 (0)