Updating past 3.1.1 breaks postCSS plugins customisation. Fully debugged, just needs fixing #10106
Closed
6 of 7 tasks
Labels
bug
An error in the Docusaurus core causing instability or issues with its execution
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
First, I'd like to thank you for the lovely tool you've made!
Why this is an issue
In our project, we use two plugins:
docusaurus-plugin-sass
and Tailwind (implemented by ourselves). Updating to anything past 3.1.1 breaks Tailwind integration in sass files, effectively breaking it everywhere in our project. This issue is unrelated to #10005.Why this is happening
I've spent a while debugging this issue and was able to narrow down the exact cause.
How plugins work in our case:
docusaurus-plugin-sass
adds a sass loader to webpack configLet's look at how things were in
3.1.1
:docusaurus/packages/docusaurus/src/commands/start.ts
Line 156 in 8017f6a
As we can see, each plugin is treated iteratively, both configureWebpack and configurePostcss are executed. Everything works fine.
Now let's look at the latest version
3.3.2
:docusaurus/packages/docusaurus/src/commands/start/webpack.ts
Line 138 in bc638d6
As we can see, first, configurePostCss is executed for ALL plugins, then configureWebpack is executed for ALL plugins. Obviously this breaks our case: first, Tailwind plugin enriches PostCSS options of css loaders, then a sass loaders are added, but they don't have necessary PostCSS plugins.
Reproducible demo
https://github.com/gemini-testing/testplane-docs
Steps to reproduce
3.1.1
Expected behavior
Sass+Tailwind work fine together as they did before.
Actual behavior
Sass loaders don't get tailwind plugins in postcss options.
Your environment
Self-service
The text was updated successfully, but these errors were encountered: