Skip to content

Commit f74a624

Browse files
committed
chore: bump version
1 parent ec1a237 commit f74a624

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

.changeset/soft-pillows-send.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tailwindcss-patch": patch
3+
---
4+
5+
fix: extract always return classSet

packages/tailwindcss-patch/src/core/patcher.ts

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,7 @@ export class TailwindcssPatcher {
234234
async extract(options?: PatchExtractOptions) {
235235
const { write } = defu<PatchExtractOptions, PatchExtractOptions[]>(options, { write: true })
236236
const { output, tailwindcss } = this.patchOptions
237-
if (output && tailwindcss) {
238-
const { filename, loose } = output
237+
if (tailwindcss) {
239238
// tailwindcss v2 + v3
240239
if (this.majorVersion === 3 || this.majorVersion === 2) {
241240
await processTailwindcss({
@@ -245,19 +244,24 @@ export class TailwindcssPatcher {
245244
}
246245

247246
const classSet = await this.getClassSet()
248-
if (filename) {
249-
const classList = [...classSet]
250-
if (write) {
251-
await fs.outputJSON(filename, classList, {
252-
spaces: loose ? 2 : undefined,
253-
})
254-
}
255-
return {
256-
filename,
257-
classList,
258-
classSet,
247+
const classList = [...classSet]
248+
const result: { classList: string[], classSet: Set<string>, filename?: string } = {
249+
classList,
250+
classSet,
251+
}
252+
if (output) {
253+
const { filename, loose } = output
254+
if (filename) {
255+
if (write) {
256+
await fs.outputJSON(filename, classList, {
257+
spaces: loose ? 2 : undefined,
258+
})
259+
}
260+
result.filename = filename
259261
}
260262
}
263+
264+
return result
261265
}
262266
}
263267

0 commit comments

Comments
 (0)