Skip to content

Commit

Permalink
Only scan src in client directory for Tailwind to prevent unnecessary…
Browse files Browse the repository at this point in the history
… rebuilds

https://tailwindcss.com/docs/content-configuration#styles-rebuild-in-an-infinite-loop

This speeds up the FE production build from 60s to ~21s on my machine, and also speeds up hot rebuilds to just ~3s
  • Loading branch information
laymonage committed May 10, 2024
1 parent a09bba6 commit 79fccc1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ module.exports = {
content: [
'./wagtail/**/*.{py,html,ts,tsx}',
'./wagtail/**/static_src/**/*.js',
'./client/**/*.{js,ts,tsx,mdx}',
// Make sure NOT to include the `client/scss` directory,
// even if we don't specify `*.scss` files here.
// The directory would still be scanned for files, which would cause
// the styles to rebuild in a loop.
// https://tailwindcss.com/docs/content-configuration#styles-rebuild-in-an-infinite-loop
'./client/src/**/*.{js,ts,tsx,mdx}',
'./docs/**/*.{md,rst}',
],
corePlugins: {
Expand Down

0 comments on commit 79fccc1

Please sign in to comment.