forked from team-innovation/vue-sfc-rollup
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 支持选择模板 #119
Comments
理想的过程vue-sfc-cli init
# 1
# Q
choose a type of the project
# A
🔘 vue 组件
🔘 插件
# 2
the project name
# 3
the owner |
关于扩展基本文件 // /commons 必要的文件,如CI和脚本 扩展/定制模板(vue 组件例子 // vue
// /templates/vue-component/index.js
exports.name = 'vue 组件' // 模板名称
exports.apply = api => {
// 做任何事情
api.on('packageJson', json => json.dependencies.vue = 'v2.6.10')
// 必要的文件不会因此而过滤
api.on('files', files => {
const newFiles = [...files, 'src/index.js', 'src/component.vue']
return newFiles
})
} |
使用到inquirer,命令行提问 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
提供初始化项目类型(支持多模板
使用 cli 生成文件时,我想通过选择我要生成的项目是什么类型,vue组件 或者 工具型 的开源项目
以致于生成后的整套文件完整的,只需要关注我要开发的文件
src
即可;不再需要修改文件以免受失误而造成的工程出错。PS: vue组件 和 工具型 应该成为模板,以方便的扩展(或许可以优化为 本地或者在线模板。
The text was updated successfully, but these errors were encountered: