postcss-use icon indicating copy to clipboard operation
postcss-use copied to clipboard

Plugin seems to be broken on PostCSS 8

Open weaversam8 opened this issue 3 years ago • 2 comments

This plugin doesn't seem to function properly on PostCSS major version 8. In tailwindlabs/tailwindcss#5429 we attempted to create a minimal reproduction case, but we were unable to get the plugin to work at all.

weaversam8 avatar Sep 10 '21 13:09 weaversam8

Hey @weaversam8,

I'm not sure this is an easy fix due to PostCSS 8's new internals. Essentially this module used to call into PostCSS to adjust the plugins list at runtime, and this worked because plugins were applied in sequence to the file.

With the new setup I am not sure that this is possible. We would probably want a way to run this plugin first before all other plugins to achieve this.

Perhaps @ai has some insights?

Thanks for reporting this! 🙂

ben-eb avatar Nov 18 '21 20:11 ben-eb

You can create Once event handler where you will walk through the AST manually and enable plugins by directly working with result.processor.

ai avatar Nov 18 '21 22:11 ai