File size: 1,101 Bytes
41a71fd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
36
37
const page = (plop) => {
    plop.setGenerator('page', {
        description: 'Создает страницу',
        prompts: [
            {
                type: 'input',
                name: 'name',
                message: 'Название страницы?',
            },
        ],
        actions: [
            {
                type: 'add',
                path: '../src/pages/{{name}}/ui/{{name}}.tsx',
                templateFile: './templates/page/page.hbs',
            },
            {
                type: 'add',
                path: '../src/pages/{{name}}/ui/{{name}}.async.tsx',
                templateFile: './templates/page/page.async.hbs',
            },
            {
                type: 'add',
                path: '../src/pages/{{name}}/ui/{{name}}.module.scss',
                templateFile: './templates/page/page.style.hbs',
            },
            {
                type: 'add',
                path: '../src/pages/{{name}}/index.ts',
                templateFile: './templates/page/index.hbs',
            },
        ],
    });
};

module.exports = page;