diff --git a/tailwind.config.js b/tailwind.config.js index eb581bf7..9ba261eb 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -3,16 +3,26 @@ const { heroui } = require("@heroui/react"); module.exports = { content: [ - // React 组件 + // React 组件(排除 node_modules) "./src/**/*.{js,jsx,ts,tsx}", "./public/index.html", - // Hero UI 组件 + // Hero UI 组件(只扫描必要的路径) "./node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}", + "./node_modules/@heroui/react/dist/**/*.{js,ts,jsx,tsx}", ], theme: { extend: {}, }, darkMode: "class", // 支持深色模式(class 或 media) plugins: [heroui()], + + // 性能优化 + safelist: [ + // Hero UI 动态类名(避免被 purge) + 'bg-gradient-to-br', + 'from-blue-500', + 'to-purple-500', + 'backdrop-blur-xl', + ], }