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执行
标签:templates,setGenerator,const,plop,require,使用,prompt 来源: https://www.cnblogs.com/zerofan/p/16514061.html