Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
template: ({ css, js, title, publicPath }: any) =>
`
<title>${title}</title>
${MiniHtmlWebpackPlugin.generateCSSReferences({ files: css, publicPath })}
<style>
body {
margin: 0;
background-color: #F8F5FD;
text-rendering: optimizeLegibility;
}
</style>
<div id="app"></div>
${MiniHtmlWebpackPlugin.generateJSReferences({ files: js, publicPath })}
`,
}),
template: ({ css, js, publicPath, title }) => {
const template = fs.readFileSync(
path.join(__dirname, 'src', 'styleguidist.html'),
'utf-8',
);
return template
.replace(
'',
`<title>${title}</title>`,
)
.replace(
'',
MiniHtmlWebpackPlugin.generateCSSReferences(css, publicPath),
)
.replace(
'',
MiniHtmlWebpackPlugin.generateJSReferences(js, publicPath),
);
},
sections: [
css,
js,
lang = 'en',
favicon,
head = [],
body = [],
trimWhitespace,
} = ctx
const headStr = `
${favicon ? `` : ''}
${head.meta ? generateMetaTags(head.meta) : ''}
${head.links ? generateLinkTags(head.links) : ''}
${head.raw ? generateRawTags(head.raw) : ''}
${head.scripts ? generateScriptTags(head.scripts) : ''}
${generateCSSReferences(css, publicPath)}`
const footerStr = `
${body.raw ? generateRawTags(body.raw) : ''}
${body.scripts ? generateScriptTags(body.scripts) : ''}
${generateJSReferences(js, publicPath)}`
const doc = ctags.html(
template({
title,
description,
lang,
head: headStr,
footer: footerStr,
publicUrl: getPublicUrl(config, dev),
})
)
${generateCSSReferences(css, publicPath)}
<div id="rsg-root"></div>
${generateJSReferences(js, publicPath)}
`;
template: ({ css, js, title, publicPath }: any) =>
`
<title>${title}</title>
${MiniHtmlWebpackPlugin.generateCSSReferences(css, publicPath)}
<style>
body {
margin: 0;
text-rendering: optimizeLegibility;
}
</style>
<div id="app"></div>
${MiniHtmlWebpackPlugin.generateJSReferences(js, publicPath)}
`,
}),
template: ({ css, js, title, publicPath }: any) =>
`
<title>${title}</title>
${MiniHtmlWebpackPlugin.generateCSSReferences(css, publicPath)}
<style>
body {
margin: 0;
text-rendering: optimizeLegibility;
}
</style>
<div id="app"></div>
${MiniHtmlWebpackPlugin.generateJSReferences(js, publicPath)}
`,
}),
${generateCSSReferences(css, publicPath)}
<div id="rsg-root"></div>
${generateJSReferences(js, publicPath)}
`;
template: ({ css, js, title, publicPath }: any) =>
`
<title>${title}</title>
${MiniHtmlWebpackPlugin.generateCSSReferences({ files: css, publicPath })}
<style>
body {
margin: 0;
background-color: #F8F5FD;
text-rendering: optimizeLegibility;
}
</style>
<div id="app"></div>
${MiniHtmlWebpackPlugin.generateJSReferences({ files: js, publicPath })}
`,
}),