Last active
August 20, 2022 06:24
-
-
Save amaankulshreshtha/a0caff1fd694017af2698b6f688b965a to your computer and use it in GitHub Desktop.
PlopFile Setup
This file contains 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 = function (plop) { | |
/** @type {import('plop').NodePlopAPI} */ | |
plop.setGenerator('common', { | |
description: 'add a common component', | |
prompts: [{ | |
type: 'input', | |
name: 'name', | |
message: 'common component name please' | |
}], | |
actions: [ | |
{ | |
type: 'add', | |
path: 'common/{{pascalCase name}}/index.js', | |
templateFile: 'plop-templates/ReactComponents/index.hbs' | |
}, | |
{ | |
type: 'add', | |
path: 'common/{{pascalCase name}}/index.styles.js', | |
templateFile: 'plop-templates/ReactComponents/index.styles.hbs' | |
}, | |
] | |
}); | |
plop.setGenerator('components', { | |
description: 'add a smart component', | |
prompts: [{ | |
type: 'input', | |
name: 'name', | |
message: 'smart component name please' | |
}], | |
actions: [ | |
{ | |
type: 'add', | |
path: 'components/{{pascalCase name}}/index.js', | |
templateFile: 'plop-templates/ReactComponents/index.hbs' | |
}, | |
{ | |
type: 'add', | |
path: 'components/{{pascalCase name}}/index.styles.js', | |
templateFile: 'plop-templates/ReactComponents/index.styles.hbs' | |
}, | |
] | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment