feat(deps): benchpressjs@2.2.1 (#8887)

Better warnings, faster template compiles
v1.18.x
Peter Jaszkowiak 4 years ago committed by GitHub
parent b63b7ae5d7
commit d30ea25629
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -240,7 +240,7 @@ async function compileTemplate() {
const source = await fs.promises.readFile(sourceFile, 'utf8');
const [compiled] = await Promise.all([
Benchpress.precompile(source),
Benchpress.precompile(source, { filename: 'install/index.tpl' }),
mkdirp(path.dirname(destJs)),
]);

@ -81,9 +81,7 @@ const buildCustomTemplates = async (config) => {
await Promise.all(templatesToBuild.map(async (template) => {
const source = await meta.templates.processImports(paths, template.path, template.text);
const compiled = await Benchpress.precompile(source, {
minify: global.env !== 'development',
});
const compiled = await Benchpress.precompile(source, { filename: template.path });
await fs.promises.writeFile(template.fullpath.replace(/\.tpl$/, '.js'), compiled);
}));

@ -111,9 +111,7 @@ async function compileTemplate(filename, source) {
}));
source = await processImports(paths, filename, source);
const compiled = await Benchpress.precompile(source, {
minify: process.env.NODE_ENV !== 'development',
});
const compiled = await Benchpress.precompile(source, { filename });
return await fs.promises.writeFile(path.join(viewsPath, filename.replace(/\.tpl$/, '.js')), compiled);
}
Templates.compileTemplate = compileTemplate;
@ -136,7 +134,7 @@ async function compile() {
await mkdirp(path.join(viewsPath, path.dirname(name)));
await fs.promises.writeFile(path.join(viewsPath, name), imported);
const compiled = await Benchpress.precompile(imported, { minify: process.env.NODE_ENV !== 'development' });
const compiled = await Benchpress.precompile(imported, { filename: name });
await fs.promises.writeFile(path.join(viewsPath, name.replace(/\.tpl$/, '.js')), compiled);
}));

Loading…
Cancel
Save