Ask any question about Tailwind CSS here... and get an instant response.
How do you use Tailwind's JIT mode to reduce build times?
Asked on Oct 27, 2025
Answer
Tailwind's Just-In-Time (JIT) mode compiles your styles on-demand as you author your HTML, significantly reducing build times and allowing for more flexibility. Here's how you can enable and use JIT mode in your Tailwind CSS project.
<!-- BEGIN COPY / PASTE -->
// tailwind.config.js
module.exports = {
mode: 'jit',
purge: ['./src/**/*.{html,js,jsx,ts,tsx}', './public/index.html'],
theme: {
extend: {},
},
variants: {},
plugins: [],
}
<!-- END COPY / PASTE -->Additional Comment:
- JIT mode is enabled by setting the "mode" property to "jit" in your Tailwind configuration file.
- The "purge" option specifies the paths to all of your template files, ensuring Tailwind only generates the styles you actually use.
- JIT mode provides faster build times and supports arbitrary value support, allowing you to use any value directly in your class names.
- Ensure your development environment is set up to watch for file changes so JIT can recompile styles as you work.
Recommended Links:
