refactor: import component css in globals.css (#32180)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Stephen Zhou
2026-02-10 13:55:42 +08:00
committed by GitHub
parent 7dabc03a08
commit 1819bd72ef
6 changed files with 15 additions and 5 deletions

View File

@@ -7,9 +7,11 @@ import { parse } from 'postcss'
import { objectify } from 'postcss-js'
export const cssAsPlugin: (cssPath: string[]) => PluginCreator = (cssPath: string[]) => {
if (process.env.NODE_ENV === 'production') {
const isTailwindCSSIntelliSenseMode = 'TAILWIND_MODE' in process.env
if (!isTailwindCSSIntelliSenseMode) {
return () => {}
}
return ({ addUtilities, addComponents, addBase }) => {
const jssList = cssPath.map(p => objectify(parse(readFileSync(p, 'utf8'))))