mirror of
https://gitee.com/fantastic-admin/basic.git
synced 2024-12-05 13:37:45 +08:00
优化 plop 启动脚本,自动读取模版目录
This commit is contained in:
parent
0e55453f3d
commit
33bef7bd93
@ -1,6 +1,8 @@
|
||||
const fs = require('node:fs')
|
||||
|
||||
module.exports = function (plop) {
|
||||
plop.setWelcomeMessage('请选择需要创建的模式:')
|
||||
plop.setGenerator('page', require('./plop-templates/page/prompt'))
|
||||
plop.setGenerator('component', require('./plop-templates/component/prompt'))
|
||||
plop.setGenerator('store', require('./plop-templates/store/prompt'))
|
||||
fs.readdirSync('./plop-templates').forEach((item) => {
|
||||
plop.setGenerator(item, require(`./plop-templates/${item}/prompt`))
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user