-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix[Tailwind]: Correct content purge paths #2
Conversation
Hey @benoror, This issue is actually by design, sort of. When we switched to using a fork, I wanted to keep our existing So, to do that and fix the issue you're seeing, we do this in
Doing it that way, the package is still installed in the I think there are two reasonable options here:
Thoughts? |
@awesomeunleashed ahhh, makes total sense! I actually like the idea of preserving that backwards-compatibility with the OG package (although I am less zero hopeful there's actually gonna be a new version coming out 😅 ) I'll like option 1., can make changes to README and leave the I also like option 2. as that won't be an issue for newcomers who skip the aliasing in package.json How about the two of them? I can work on the changes |
@awesomeunleashed ok here's what I tried:
-- "@cast-corp/windmill-react-ui": "0.7.4",
++ "@windmill/react-ui": "npm:@cast-corp/windmill-react-ui@^0.7.4",
-- import { ... } from "@cast-corp/windmill-react-ui"
++ import { ... } from "@windmill/react-ui" including this -- const windmill = require('@cast-corp/windmill-react-ui/config')
++ const windmill = require('@windmill/react-ui/config')
content: [
"./pages/**/*.{js,ts,jsx,tsx}",
"./components/**/*.{js,ts,jsx,tsx}",
-- "../../node_modules/@cast-corp/windmill-react-ui/lib/defaultTheme.js",
-- "../../node_modules/@cast-corp/windmill-react-ui/dist/index.js",
], Unfortunately I get the same styling issue afterwards (in next.js production build), if I bring the content-purge lines back (with corrected alias path) it seems to work well again: content: [
"./pages/**/*.{js,ts,jsx,tsx}",
"./components/**/*.{js,ts,jsx,tsx}",
++ "../../node_modules/@windmill/react-ui/lib/defaultTheme.js",
++ "../../node_modules/@windmill/react-ui/dist/index.js",
], 🤔 Wondering what it could be then? |
Hmm. It does sound like that should have worked. I'll verify the classes are actually purged correctly from those files in our project (we've overridden almost all of the default theme, so it might be possible that it actually hasn't been working but everything was just being picked up from the custom theme).
Just to be sure we're looking at the same thing, your const windmill = require("@windmill/react-ui/config");
module.exports = windmill({
// content, darkMode, plugins, theme, etc.
}); |
yup, here's is it: const defaultTheme = require('tailwindcss/defaultTheme');
const windmill = require('@windmill/react-ui/config')
module.exports = windmill({
content: [
"./pages/**/*.{js,ts,jsx,tsx}",
"./components/**/*.{js,ts,jsx,tsx}",
"../../node_modules/@windmill/react-ui/lib/defaultTheme.js",
"../../node_modules/@windmill/react-ui/dist/index.js",
],
theme: { ... },
plugins: [],
}) |
Perhaps it could be because (I assume based on these paths) your If that is the issue, then those lines would have to be updated to always find |
That was one of my suspicions before (#1 (comment)), let me try again with this new context |
@awesomeunleashed It did work! I assume postcss is not smart enough to deduce paths for workspaces during the build phase. I'll keep those two purge lines as a reminder. Thinking it twice now I don't think many people would face this issue unless they have an exotic folder structure, so I am ok closing this if you're |
Great, glad you got it working. I'm guessing there's a way to make those paths search for the correct I did add installation notes to the README with a summary of the relevant information from our discussions. |
@awesomeunleashed you're great, thanks so much for your time! |
Closes #1