postcss-mixins: Performance degradation in v11 when using "mixinsFiles"

Hi,

we are using PostCSS with this plugin and vite and have noticed a pretty significant performance degradation starting with v11 when using the mixinsFiles option.

As soon as either multiple files are referenced or a glob is used responses from vite dev server are stuck in pending state for a long time when first starting the dev server.

Examples:

    "postcss-mixins": {
      "silent": true,
      "mixinsFiles": ["src/Global.mixins.css"]
    },

using 11.0.1 Screenshot 2024-09-25 at 11 40 23

using 10.0.1 Screenshot 2024-09-25 at 11 55 37

As long as only one file (without any glob patterns) is referenced everything seems to work as before. However, when referencing multiple files this changes:

    "postcss-mixins": {
      "silent": true,
      "mixinsFiles": ["src/Shared.mixins.css", "src/Global.mixins.css"]
    },

using 11.0.1 Screenshot 2024-09-25 at 11 52 16

using 10.0.1 Screenshot 2024-09-25 at 11 56 46

As shown in the screenshots the first load of localhost takes nearly 23 seconds when using v11.0.1 in comparison to 56ms in v10.0.1. Nothing else changed between the two runs. It also doesn’t matter whether the referenced files exist or not.

The only real difference I can see in the two versions is the change from fast-glob to tinyglobby so it seems like this has made some kind of impact.

Any help on how to fix this issue would be much appreciated.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 20 (14 by maintainers)

Most upvoted comments

@SuperchupuDev thank you! This definitely seems to have massively improved performance back to how it was before 😃

@RubenStoesser i think i’ve managed to solve the perf issue in a simpler way, can you add the following line to your package.json and check if it works after reinstalling dependencies? i’ll try to release a new tinyglobby version with the fix if it does

"resolutions": {
  "tinyglobby": "https://pkg.pr.new/tinyglobby@f819a2a"
},