Version 4 plugins not working? #15458
Unanswered
cyberalien
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to port a plugin to version 4 to use
@plugin
directive, this is code I'm trying to make work:It is in monorepo, so one package for plugin, one package for demo. Using
@plugin 'test-plugin';
seems to work, but plugin does not work.In logs I see:
So Tailwind does import plugin and it should work.
What I don't see in log is
Plugin is initialised
, so plugin is not actually being called.Since I couldn't find any documentation on building plugins for version 4, with trial and error it looks like
import plugin from 'tailwindcss/plugin';
is sort of working (see below).Issues with code
There are few issues with code sample above though, so I'm not even sure if it is correct way to build a plugin:
testPlugin()
:matchComponents
, so had to disable@typescript-eslint/unbound-method
rule:"moduleResolution": "nodenext",
in tsconfig, otherwise import fortailwindcss/plugin
cannot be resolved.All of that is very strange, which leads me to believe that I'm building plugin incorrectly and it should be imported from a different package, not from
tailwindcss/plugin
.What am I doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions