mirror of
https://github.com/tcsenpai/obsidiangarden_netlify.git
synced 2025-06-06 04:35:20 +00:00
Check for ELEVENTY_ENV for minifier (#237)
* fix: check for ELEVENTY_ENV for minifier * turn on `conservativeCollapse` and `preserveLineBreaks` for HTML minifier
This commit is contained in:
parent
046f8a7bac
commit
40c2b78cf5
@ -490,7 +490,7 @@ module.exports = function (eleventyConfig) {
|
||||
|
||||
eleventyConfig.addTransform("htmlMinifier", (content, outputPath) => {
|
||||
if (
|
||||
process.env.NODE_ENV === "production" &&
|
||||
(process.env.NODE_ENV === "production" || process.env.ELEVENTY_ENV === "prod") &&
|
||||
outputPath &&
|
||||
outputPath.endsWith(".html")
|
||||
) {
|
||||
@ -498,6 +498,8 @@ module.exports = function (eleventyConfig) {
|
||||
useShortDoctype: true,
|
||||
removeComments: true,
|
||||
collapseWhitespace: true,
|
||||
conservativeCollapse: true,
|
||||
preserveLineBreaks: true,
|
||||
minifyCSS: true,
|
||||
minifyJS: true,
|
||||
keepClosingSlash: true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user