Skip to content

Commit 19bc9c7

Browse files
authoredSep 28, 2024··
fix(postcss): postcss dependency should always be added (#4161)
1 parent f21efd5 commit 19bc9c7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed
 

‎packages/postcss/src/esm.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -136,20 +136,20 @@ export function createPlugin(options: UnoPostcssPluginOptions) {
136136
for (let i = 0; i < entries.length; i += BATCH_SIZE) {
137137
const batch = entries.slice(i, i + BATCH_SIZE)
138138
promises.push(...batch.map(async (file) => {
139-
const { mtimeMs } = await stat(file)
140-
141-
if (fileMap.has(file) && mtimeMs <= fileMap.get(file))
142-
return
143-
144-
fileMap.set(file, mtimeMs)
145-
146139
result.messages.push({
147140
type: 'dependency',
148141
plugin: directiveMap.unocss,
149142
file: normalize(file),
150143
parent: from,
151144
})
152145

146+
const { mtimeMs } = await stat(file)
147+
148+
if (fileMap.has(file) && mtimeMs <= fileMap.get(file))
149+
return
150+
151+
fileMap.set(file, mtimeMs)
152+
153153
const content = await readFile(file, 'utf8')
154154
const { matched } = await uno.generate(content, {
155155
id: file,

0 commit comments

Comments
 (0)
Please sign in to comment.