PlayForm / Compress

🗜️ Compress —

Home Page:https://NPMJS.Org/@playform/compress

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTML minifier too aggressive with whitespaces

gw2princeps opened this issue · comments

Hey,

so it appears like this minifier removes all kinds of whitespaces, even those in front of an astro component.

image
Compared to what it looks like with html: false.
image

I think it is sensible to preserve these whitespaces.

Without collapseWhitespace: true the website doesn't get minified at all. You can put an   before the web component or style it using CSS. Alternatively, you can disable the whitespace collapse by setting:

// @ts-nocheck
import { defineConfig } from "astro/config";

import compress from "astro-compress";
export default defineConfig({
	integrations: [
		compress({
			html: {
				collapseWhitespace: false,
			},
		}),
	],
});