javascript - 是否可以在 PLOP 中使用单个 templateFile 添加多个文件
问题描述
我正在使用 plop 依赖来生成模块。我想一次性生成 n 个使用单个模板的文件。
plop.setGenerator('module', {
description: 'Create a module',
// User input prompts provided as arguments to the template
prompts: [
{
// Raw text input
type: 'input',
// Variable name for this input
name: 'name',
// Prompt to display on command line
message: 'What is your module name?'
}
],
actions: [
{
// Add a new file
type: 'addMany',
// Path for the new file
destination: 'src/Screens/{{pascalCase name}}',
// Handlebars template used to generate content of new file
templateFiles: 'plop-templates/**.js.hbs'
}
]
})
解决方案
将 templateFiles 包装在数组中。
templateFiles: ['plop-templates/**.js.hbs']
推荐阅读
- spring-data-mongodb - 何时使用 MongoOperations 和 MongoTemplate?
- ruby - 使用 youtube api,如何在 ruby 中上传私人视频?
- java - Kafka Stream 和 KGlobalTable Join 问题
- oracle - 在 Oracle 11g 中使用 ORACLE“FOR UPDATE SKIP LOCKED”选择非锁定行
- r - 为什么我们在向量中省略 NULL 值而不是用 0 替换?
- php - 如何访问 JSON 的某些部分?
- bash - 如何使用 bash 管道保留除第一个令牌之外的所有内容?
- python - 从烧瓶中的表单获取数据的问题
- python - 如何在 python 中生成 JWT 断言
- spring-batch - SQL [SELECT * FROM AH_PATIENT] 的未分类 SQLException;SQL状态[60000];错误代码[604];ORA-00604: 递归 SQL 级别 1 发生错误