File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 11import tailwindPoscss from "@tailwindcss/postcss" ;
22import postcss from "postcss" ;
33import type { ResolvedFreshConfig } from "fresh" ;
4- import type { Processor } from "postcss" ;
4+ import type { Plugin , Processor } from "postcss" ;
55
66export function initTailwind (
77 config : ResolvedFreshConfig ,
88) : Processor {
9- const res = postcss ( tailwindPoscss ( {
10- optimize : config . mode === "production" ,
11- } ) ) ;
12-
13- return res ;
9+ return postcss ( [
10+ tailwindPoscss ( {
11+ optimize : config . mode === "production" ,
12+ } ) ,
13+ ] as Plugin [ ] ) ;
1414}
Original file line number Diff line number Diff line change @@ -12,13 +12,14 @@ export function tailwind<T>(
1212 { pluginName : "tailwind" , filter : / \. c s s $ / } ,
1313 async ( args ) => {
1414 if ( ! processor ) processor = initTailwind ( app . config ) ;
15- const instance = await processor ;
15+ const instance = processor ;
1616 const res = await instance . process ( args . text , {
1717 from : args . path ,
1818 } ) ;
19+
1920 return {
2021 content : res . content ,
21- map : res . map ? .toString ( ) ,
22+ map : res . map . toString ( ) ,
2223 } ;
2324 } ,
2425 ) ;
You can’t perform that action at this time.
0 commit comments