templates directory per project
- 主要语言
- JavaScript
- 星标
- 4
- 派生
- 5
- PR 合并指标
- 30 天内没有已合并 PR
描述
A quick, and beautifull enhancement (;P) of a way that scaffold templates are generated. If 'YOUR_PROJECT/.templates' directory exists and template file exists inside, it will be used by scaffold generator instead of that default one from 'ejs-ext' templates directory.
``` javascript
exports.template = function (name) {
try {
stats = fs.lstatSync(process.cwd() + '/.templates/' + name + '.ejs');
if (stats.isFile()) {
return process.cwd() + '/.templates/' + name + '.ejs';
}
}
catch (e) {}
return __dirname + '/templates/' + name + '.ejs';
};
```
Sorry that it is not a pull request, but i was enlightened in some place, where i'm unabe to do that ;-)
贡献指南
这个仓库没有索引到贡献指南
调研方向
Look at the scaffold generator code in the ejs-ext project to find where templates are currently loaded. The issue provides a sample function; implement it to check for a .templates directory in the project root and fall back to the default. Test by creating a custom template in .templates and running a scaffold command to verify it's used.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- tooling
- Issue 类型
- 功能
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 70/100