This commit is contained in:
Yuri Kuznetsov
2024-12-18 20:04:56 +02:00
parent 59c1962152
commit ad8858bdb0
+5 -5
View File
@@ -35,23 +35,23 @@ class LayoutTemplateBundler {
* @return {string}
*/
bundle() {
let path = 'client/res/layout-types';
const path = 'client/res/layout-types';
/** @var {string[]} */
let files = globSync(path + '/*.tpl')
const files = globSync(path + '/*.tpl')
.map(file => file.replaceAll('\\', '/'));
let map = {};
const map = {};
files.forEach(file => {
let name = file
const name = file
.substring(path.length + 1)
.slice(0, -4);
map[name] = fs.readFileSync(file, 'utf8');
});
let mapPart = JSON.stringify(map);
const mapPart = JSON.stringify(map);
return `\nEspo.layoutTemplates = ${mapPart};\n`;
}