添加cache-loader,debug模式下不再使用template缓存,修复一些 bug

This commit is contained in:
undefined committed 2020-07-11 20:00:43 +08:00
1 parent dd7914e1fb
commit 11368bc831
21 files changed
+248 -266

No files matched your search

-21
View File
@@ -24,27 +24,6 @@ const build = (dirOrObject) => {
templates[i] = template;
}
} else templates = dirOrObject;
for (const i in templates) {
if (i.endsWith('.html') && !global.DEBUG && !templates[i].includes('No Compression')) {
templates[i] = templates[i]
.trim()
.replace(/ *\n */gmi, ' ')
.replace(/, /gmi, ',')
.replace(/%} {%/gmi, '%}{%')
.replace(/ %}/gmi, '%}')
.replace(/{% /gmi, '{%')
.replace(/> </gmi, '><')
.replace(/}} </gmi, '}}<')
.replace(/> {{/gmi, '>{{')
.replace(/{{ /gmi, '{{')
.replace(/ }}/gmi, '}}')
.replace(/%} </gmi, '%}<')
.replace(/> {%/gmi, '>{%')
.replace(/= /gmi, '=')
.replace(/ =/gmi, '=')
.trim();
}
}
return templates;
};