-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplopfile.js
More file actions
33 lines (33 loc) · 1021 Bytes
/
plopfile.js
File metadata and controls
33 lines (33 loc) · 1021 Bytes
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
module.exports = plop => {
plop.setGenerator('component', {
description: 'Create a component',
// User input prompts provided as arguments to the template
prompts: [
{
// Raw text input
type: 'input',
// Variable name for this input
name: 'name',
// Prompt to display on command line
message: 'What is your component name?'
}
],
actions: [
{
// Add a new file
type: 'add',
// Path for the new file
path: 'src/components/{{lowerCase name}}/index.jsx',
// Handlebars template used to generate content of new file
templateFile: 'plop-templates/Component.js.hbs'
}, {
// Add a new file
type: 'add',
// Path for the new file
path: 'src/components/{{lowerCase name}}/{{pascalCase name}}.stories.js',
// Handlebars template used to generate content of new file
templateFile: 'plop-templates/Component.stories.js.hbs'
}
]
})
}