forked from panaverse-io/energy-website
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplopfile.js
34 lines (34 loc) · 918 Bytes
/
plopfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
module.exports = function (plop) {
plop.setGenerator("component", {
description: "Create a component",
prompts: [
{
type: "input",
name: "name",
message: "What is this component's name?",
},
{
type: "input",
name: "element",
message: "HTML element (div is default)",
default: "div",
},
],
actions: [
{
type: "addMany",
base: `templates/components`,
templateFiles: `templates/components/*.hbs`,
destination: "components/{{camelCase name}}",
},
{
// Action type 'append' injects a template into an existing file
type: "append",
path: "./components/index.ts",
// Pattern tells plop where in the file to inject the template
pattern: `// Components`,
template: `export * from './{{camelCase name}}';`,
},
],
});
};