Can someone help me get JIT mode working with create-react-app? #4887
Unanswered
averybuehler
asked this question in
Help
Replies: 2 comments 4 replies
-
Try moving the env variable before the script:
If that doesn't help, honestly if you can I would highly recommend switching to Vite, it's much more actively maintained, faster, and uses recent versions of all of its dependencies so you don't need to use the postcss7-compat build or the |
Beta Was this translation helpful? Give feedback.
0 replies
-
Have a look here. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm currently learning React and want to use Tailwindcss' JIT mode. I've looked through other discussions and issues, but none of the proposed solutions work for me. I currently have to rebuild the entire project to see my changes reflected, and
variants
do not seem to be working at all.I have a
create-react-app
project with the following structure:/src/
/src/components/
/src/components/citations/
with components inside each of these directories.
Here are some snippets of my project:
package.json:
"start": "craco start TAILWIND_MODE=watch",
"devDependencies": { "@tailwindcss/jit": "^0.1.18", "autoprefixer": "^9.8.6", "postcss": "^7.0.36", "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.4" }
/src/index.css:
@tailwind base; @tailwind components; @tailwind utilities; @tailwind variants;
tailwind.config.js:
mode: 'jit',
purge: ['./src/**/*.{js,jsx,ts,tsx}', './public/index.html', './src/components/*.{js,jsx}'],
I'm pretty sure my
purge
directories are correct, so I'm not sure why my changes aren't being reflected. Does anyone know what I'm doing wrong? I'm honestly considering porting toNext.js
to use Trailwindcss' JIT mode, but since I'm new to the React ecosystem, I'd prefer not to.Thank you in advance!
Beta Was this translation helpful? Give feedback.
All reactions