ref
This commit is contained in:
@@ -35,23 +35,23 @@ class LayoutTemplateBundler {
|
|||||||
* @return {string}
|
* @return {string}
|
||||||
*/
|
*/
|
||||||
bundle() {
|
bundle() {
|
||||||
let path = 'client/res/layout-types';
|
const path = 'client/res/layout-types';
|
||||||
|
|
||||||
/** @var {string[]} */
|
/** @var {string[]} */
|
||||||
let files = globSync(path + '/*.tpl')
|
const files = globSync(path + '/*.tpl')
|
||||||
.map(file => file.replaceAll('\\', '/'));
|
.map(file => file.replaceAll('\\', '/'));
|
||||||
|
|
||||||
let map = {};
|
const map = {};
|
||||||
|
|
||||||
files.forEach(file => {
|
files.forEach(file => {
|
||||||
let name = file
|
const name = file
|
||||||
.substring(path.length + 1)
|
.substring(path.length + 1)
|
||||||
.slice(0, -4);
|
.slice(0, -4);
|
||||||
|
|
||||||
map[name] = fs.readFileSync(file, 'utf8');
|
map[name] = fs.readFileSync(file, 'utf8');
|
||||||
});
|
});
|
||||||
|
|
||||||
let mapPart = JSON.stringify(map);
|
const mapPart = JSON.stringify(map);
|
||||||
|
|
||||||
return `\nEspo.layoutTemplates = ${mapPart};\n`;
|
return `\nEspo.layoutTemplates = ${mapPart};\n`;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user