const rollupPluginHtml = require('@rollup/plugin-html'); const makeHtmlAttributes = (attributes) => { if (!attributes) { return ''; } const keys = Object.keys(attributes); // eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-return-assign return keys.reduce((result, key) => (result += ` ${key}="${attributes[key]}"`), ''); }; const genHtmlTemplateFunc = (contentOrContentFn) => ({ attributes, files, meta, publicPath, title, }) => { const scripts = (files.js || []) .map( ({ fileName }) => `` ) .join('\n'); const links = (files.css || []) .map( ({ fileName }) => `` ) .join('\n'); const metas = meta.map((input) => ``).join('\n'); return `
${metas}