Compress icon indicating copy to clipboard operation
Compress copied to clipboard

Media Queries are deleted

Open zokkis opened this issue 1 year ago • 4 comments

All of my media queries are deleted after adding astro-compress

zokkis avatar Dec 31 '23 16:12 zokkis

Hi, can you provide a minimum viable reproduction, maybe on Stackblitz or CodeSandbox?

NikolaRHristov avatar Jan 01 '24 13:01 NikolaRHristov

I dont know why, but I cant reproduce it with a new install. But I can reproduce it on my project, even tho I run npm i and npm ci and disabled all the other integrations, but on my project is still the error

{
	"@astrojs/check": "^0.3.4",
	"@astrojs/mdx": "^2.0.3",
	"astro": "^4.0.7",
	"astro-compress": "astro-community/AstroCompress#no-sharp",
	"astro-purgecss": "^4.0.0",
	"node-html-parser": "^6.1.12",
	"purgecss": "^5.0.0",
	"sass": "^1.69.5",
	"sharp": "^0.33.1",
	"typescript": "^5.3.3"
}

astro-integrations (as I said, I tried to disable and still same problem)

[
	purgecss({ variables: true }),
	compress({ Image: false }),
	mdx()
]

tsconfig

{
	"extends": "astro/tsconfigs/strictest",
	"compilerOptions": {
		"baseUrl": ".",
		"paths": {
			"@/*": ["./*"],
			"@public/*": ["./public/*"],
			"@src/*": ["./src/*"],
			"@components/*": ["./src/components/*"],
			"@i18n/*": ["./src/i18n/*"],
			"@layouts/*": ["./src/layouts/*"],
			"@pages/*": ["./src/pages/*"],
			"@shared/*": ["./src/shared/*"],
			"@styles/*": ["./src/styles/*"]
		}
	}
}

zokkis avatar Jan 01 '24 14:01 zokkis

astro-purgecss could be removing some of your CSS, have you tried running without it?

NikolaRHristov avatar Jan 01 '24 14:01 NikolaRHristov

disabled all the other integrations, but on my project is still the error

So, yes I tried without any other integrations and I reinstalled Ubuntu and same problem

zokkis avatar Jan 02 '24 20:01 zokkis

Should be fixed in the latest astro-compress v2.2.23 and @playform/compress v0.0.4

NikolaRHristov avatar May 09 '24 17:05 NikolaRHristov