INNER CODE UNIT · JavaScript
makeTemplates
danmindru/responsive-html-email-signature · tasks/build.js:21
function makeTemplates(dir, confItems) {
return confItems.map(async conf => {
const cwd = `${options.workingDir}/${dir}`;
/**
* Find stylesheets relative to the CWD & generate <link> tags.
* This way we can automagically inject them into <head>.
*/
const files = await getFilePathsForDir(cwd);
const context = Object.assign(conf, {
stylesheets: getCssLinkTagsFromFilelist(files)
});
return options
.src([cwd + '/**/*.html', '!' + cwd + '/**/*.inc.html'])
.pipe(preprocess({ context }))
.pipe(inlineImg({ getHTTP: confItems[0]['inlineRemoteUrl'] }))
.pipe(