plop-templates使用
const viewGenerator = require('./plop-templates/view/prompt') const componentGenerator = require('./plop-templates/component/prompt') const storeGenerator = require('./plop-templates/store/prompt.js') module.exports = function(plop) { plop.setGenerator('view', viewGenerator) plop.setGenerator('component', componentGenerator) plop.setGenerator('store', storeGenerator) }
"scripts": { "new": "plop" }
plop-templates模板文件:https://gitee.com/zerofan/plop-templates/tree/master
1. npm install plop
2. package.json scripts配置
3. npm run new执行