1 | import path from "path";
|
2 |
|
3 | export const getTemplateDirectory : () => string = () => path.resolve(__dirname, "../templates");
|
4 |
|
5 | export const getTemplateFilePath : (template: string) => string = (template: string) => {
|
6 | const templateDirectory : string = getTemplateDirectory();
|
7 | return `${templateDirectory}/template.${template}.njk`
|
8 | }
|
9 |
|
10 | export const getBuiltInTemplates = () => {
|
11 |
|
12 | const templateDirectory = getTemplateDirectory();
|
13 |
|
14 | return {
|
15 | css: { path: path.join(templateDirectory, "template.css.njk") },
|
16 | html: { path: path.join(templateDirectory, "template.html.njk") },
|
17 | json: { path: path.join(templateDirectory, "template.json.njk") },
|
18 | scss: { path: path.join(templateDirectory, "template.scss.njk") },
|
19 | styl: { path: path.join(templateDirectory, "template.styl.njk") },
|
20 | };
|
21 |
|
22 | }
|