mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Added banner to compiled files and minify SVGs
This commit is contained in:
parent
b36a725d30
commit
98a62074ad
@ -199,8 +199,15 @@ module.exports = (_env, args) => { // eslint-disable-line complexity
|
||||
from: "**/*.html",
|
||||
transform: content => {
|
||||
const metadata = require(path.resolve(__dirname, "package.json"))
|
||||
return html.minify(content.toString(), {
|
||||
const banner =
|
||||
`{#-\n` +
|
||||
` This file was automatically generated - do not edit\n` +
|
||||
`-#}\n`
|
||||
return banner + html.minify(content.toString(), {
|
||||
collapseBooleanAttributes: true,
|
||||
collapseWhitespace: true,
|
||||
collapseInlineTagWhitespace: false,
|
||||
conservativeCollapse: false,
|
||||
includeAutoGeneratedTags: false,
|
||||
minifyCSS: true,
|
||||
minifyJS: true,
|
||||
@ -282,17 +289,12 @@ module.exports = (_env, args) => { // eslint-disable-line complexity
|
||||
/* Minify images */
|
||||
new ImageminPlugin({
|
||||
test: /\.(ico|png|svg)$/i,
|
||||
svgo: null
|
||||
// Hack: Temporarily disabled, as SVGO removes the viewbox property
|
||||
// and setting the plugin to false doesn't have any effect.
|
||||
// {
|
||||
// plugins: [
|
||||
// {
|
||||
// cleanupIDs: false,
|
||||
// removeViewBox: false
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
svgo: {
|
||||
plugins: [
|
||||
{ cleanupIDs: false },
|
||||
{ removeViewBox: false }
|
||||
]
|
||||
}
|
||||
}),
|
||||
|
||||
/* Write manifest */
|
||||
|
Loading…
Reference in New Issue
Block a user