diff --git a/.tailwindignore b/.tailwindignore new file mode 100644 index 00000000..ab1ac655 --- /dev/null +++ b/.tailwindignore @@ -0,0 +1,28 @@ +# Tailwind 忽略文件 - 明确排除不需要扫描的目录 + +# 构建输出 +build/ +dist/ + +# Python 相关 +venv/ +__pycache__/ +*.pyc +migrations/ + +# 依赖 +node_modules/ + +# 文档和配置 +docs/ +scripts/ +certs/ + +# 日志和临时文件 +*.log +flask_session/ + +# 其他 +*.docx +*.csv +*.conf diff --git a/tailwind.config.js b/tailwind.config.js index 9e6f91e7..55557b6d 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,16 +1,16 @@ /** @type {import('tailwindcss').Config} */ const { heroui } = require("@heroui/react"); -const path = require("path"); module.exports = { content: [ - // 使用绝对路径(Tailwind 推荐方式,避免误报) - path.join(__dirname, "./src/**/*.{js,jsx}"), - path.join(__dirname, "./public/index.html"), + // 只扫描 src 和 public 目录(不使用 glob,精确指定) + "src/**/*.js", + "src/**/*.jsx", + "public/index.html", - // Hero UI 组件库 - path.join(__dirname, "./node_modules/@heroui/theme/dist/**/*.js"), - path.join(__dirname, "./node_modules/@heroui/react/dist/**/*.js"), + // Hero UI 组件库(仅必需文件) + "node_modules/@heroui/theme/dist/components/*.js", + "node_modules/@heroui/react/dist/index.js", ], darkMode: "class",