0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-24 10:58:52 +01:00
wagtail/tailwind.config.js
Sage Abdullah c8aeee941a
Only scan src in client directory for Tailwind to prevent unnecessary 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
2024-05-17 09:46:28 +01:00

24 lines
731 B
JavaScript

const baseConfig = require('./client/tailwind.config');
/**
* Tailwind config file for Wagtail itself.
*/
module.exports = {
presets: [baseConfig],
content: [
'./wagtail/**/*.{py,html,ts,tsx}',
'./wagtail/**/static_src/**/*.js',
// 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: {
// Risk of clashing with existing styles.
preflight: false,
},
};