UNPKG

805 BPlain TextView Raw
1import path from "path";
2
3export const getTemplateDirectory : () => string = () => path.resolve(__dirname, "../templates");
4
5export const getTemplateFilePath : (template: string) => string = (template: string) => {
6 const templateDirectory : string = getTemplateDirectory();
7 return `${templateDirectory}/template.${template}.njk`
8}
9
10export 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}