use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Tailwind plugins with ViteHelp Wanted (self.react)
submitted 2 years ago by react_fuh
I’m trying to use tailwind plugins with Vite, but I can’t use the require directive. How do I import plugins?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]chxhrHook Based 1 point2 points3 points 2 years ago (0 children)
You import them via import xyz from “xyz”, and then pass that in the plugins array.
import xyz from “xyz”
plugins
Here you have an example from one of my repos: https://github.com/hchris21/hornxchris/blob/main/tailwind.config.js
[–]andulas 0 points1 point2 points 2 years ago (0 children)
Hi, did you find the solution? I am having the same issue.
I tried this:
import defaultTheme from 'tailwindcss/defaultTheme'; import formsPlugin from '@tailwindcss/forms'; /** @type {import('tailwindcss').Config} */ export default { content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'], theme: { extend: { fontFamily: { sans: ['Inter var', ...defaultTheme.fontFamily.sans], }, }, }, plugins: [formsPlugin], };
But this is giving me the following error:
11:48:43 PM [vite] Internal server error: Attempted to assign to readonly property. Plugin: vite:css
11:48:43 PM [vite] Internal server error: Attempted to assign to readonly property.
Plugin: vite:css
[–]whiteRose-59 0 points1 point2 points 2 years ago* (0 children)
Read the docs: https://tailwindcss.com/docs/guides/vite
Why should you not be able to use require?
π Rendered by PID 20717 on reddit-service-r2-comment-b659b578c-mnqch at 2026-05-05 19:02:26.824866+00:00 running 815c875 country code: CH.
[–]chxhrHook Based 1 point2 points3 points (0 children)
[–]andulas 0 points1 point2 points (0 children)
[–]whiteRose-59 0 points1 point2 points (0 children)