Created
June 8, 2021 23:42
-
-
Save jonasmarco/26e0c407b4c922e916bfe3de2007767d to your computer and use it in GitHub Desktop.
A plop file example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = (plop) => { | |
plop.setGenerator('component', { | |
description: 'Create a component', | |
prompts: [ | |
{ | |
type: 'input', | |
name: 'name', | |
message: 'What is your component name?' | |
} | |
], | |
actions: [ | |
{ | |
type: 'add', | |
path: '../src/components/{{pascalCase name}}/index.tsx', | |
templateFile: 'templates/Component.tsx.hbs' | |
}, | |
{ | |
type: 'add', | |
path: '../src/components/{{pascalCase name}}/stories.tsx', | |
templateFile: 'templates/stories.tsx.hbs' | |
}, | |
{ | |
type: 'add', | |
path: '../src/components/{{pascalCase name}}/test.tsx', | |
templateFile: 'templates/test.tsx.hbs' | |
} | |
] | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment