-
Notifications
You must be signed in to change notification settings - Fork 0
/
plopfile.js
35 lines (33 loc) · 894 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
35
/* eslint-disable func-names */
module.exports = function(plop) {
plop.setGenerator('Component', {
description: 'create components in /components',
prompts: [
{
type: 'prompt',
name: 'componentName',
message: 'Name of your component:',
},
],
actions: answers => {
const actions = [
{
type: 'add',
path: './src/components/{{properCase componentName}}/index.ts',
templateFile: './plop/component/index.ts.plop',
},
{
type: 'add',
path: './src/components/{{properCase componentName}}/{{properCase componentName}}.module.sass',
templateFile: './plop/component/component.module.sass.plop',
},
];
actions.push({
type: 'add',
path: './src/components/{{properCase componentName}}/{{properCase componentName}}.tsx',
templateFile: './plop/component/component.tsx.plop',
});
return actions;
},
});
};