-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docusaurus 3.4.0+ does not respect PostCSS plugins when it minimizes CSS files from 'static' folder #10334
Comments
Actually the problem is more likely to be:
I'd be curious to see what result you get with v3.2, but I suspect it's like v3.4. v3.3 is the probably anomaly here, and probably didn't run your file against postcss. Looks like our minifier does not support nesting, even if you add the preset yourself. That's probably the real issue here. I'd also try running with |
After trying different Docusaurus versions, here are the results. Docusaurus v3.2.1 works as expected, as well as Docusaurus v3.1.1 and prior versions back to Docusaurus v2.x.
It does not pose a problem because PostCSS addons provided by
When The biggest observed difference is:
|
Thanks for investigating. I'm not sure what is happening here, will need to study the problem to figure out. |
fixed in 3.6.1 |
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
Docusaurus 3.4.0+ tries to minimize CSS files from
static
directory, while Docusaurus 3.3.2 and earlier just kept them intact. While doing that CSS minimization, Docusaurus 3.4.0+ forgets to initialize PostCSS correctly, ignoring custom plugins like they do not exist. This leads to numerous issues in projects that use CSS 3 syntax in static CSS files, because they cannot be built without producing warnings and errors.This is a regressive behavior. The same projects worked in Docusaurus 3.3.2 and earlier. An alternative solution would be to instruct Docusaurus 3.4.0+ to exclude CSS files from
static
folder minimization.Reproducible demo
https://github.com/hrumhurum/docusaurus-postcss-issue-repro
Steps to reproduce
Enter the directory of a corresponding sample:
cd 3.3.2
orcd 3.4.0
Install the missing dependencies. This creates
node_modules
directory which is notincluded in this repository:
npm install
Build the project
npm run build
Expected behavior
Actual behavior
Your environment
Self-service
The text was updated successfully, but these errors were encountered: