mirror of
https://github.com/tcsenpai/obsidiangarden_netlify.git
synced 2025-06-06 20:55:21 +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) => {
|
eleventyConfig.addTransform("htmlMinifier", (content, outputPath) => {
|
||||||
if (
|
if (
|
||||||
process.env.NODE_ENV === "production" &&
|
(process.env.NODE_ENV === "production" || process.env.ELEVENTY_ENV === "prod") &&
|
||||||
outputPath &&
|
outputPath &&
|
||||||
outputPath.endsWith(".html")
|
outputPath.endsWith(".html")
|
||||||
) {
|
) {
|
||||||
@ -498,6 +498,8 @@ module.exports = function (eleventyConfig) {
|
|||||||
useShortDoctype: true,
|
useShortDoctype: true,
|
||||||
removeComments: true,
|
removeComments: true,
|
||||||
collapseWhitespace: true,
|
collapseWhitespace: true,
|
||||||
|
conservativeCollapse: true,
|
||||||
|
preserveLineBreaks: true,
|
||||||
minifyCSS: true,
|
minifyCSS: true,
|
||||||
minifyJS: true,
|
minifyJS: true,
|
||||||
keepClosingSlash: true,
|
keepClosingSlash: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user