import template from './template'; export const headTemplate = ({ css, htmlAttributes, bundledJsCssUrlRewriteHook, head, dynamicHead, }) => [ ' template(' <%= attrName %>="<%- attrValue %>"')({ attrName: key, attrValue: htmlAttributes[key], }) ).join('') + '>', '', head, dynamicHead, ...(css || []).map(file => template(' ')({ href: bundledJsCssUrlRewriteHook(file.url), }) ), '', '', ].join('\n'); // Template function for rendering the boilerplate html for browsers export const closeTemplate = ({ meteorRuntimeConfig, rootUrlPathPrefix, inlineScriptsAllowed, js, additionalStaticJs, bundledJsCssUrlRewriteHook, }) => [ '', inlineScriptsAllowed ? template(' ')({ conf: meteorRuntimeConfig, }) : template(' ')({ src: rootUrlPathPrefix, }), '', ...(js || []).map(file => template(' ')({ src: bundledJsCssUrlRewriteHook(file.url), }) ), ...(additionalStaticJs || []).map(({ contents, pathname }) => ( inlineScriptsAllowed ? template(' ')({ contents, }) : template(' ')({ src: rootUrlPathPrefix + pathname, }) )), '', '', '', '' ].join('\n');