@@ -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