Commit d6916ed 1 parent 50877a2 commit d6916ed Copy full SHA for d6916ed
File tree 1 file changed +14
-12
lines changed
1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,17 @@ function oneOf(...options) {
146
146
)
147
147
}
148
148
149
+ function loadPostcss ( ) {
150
+ // Try to load a local `postcss` version first
151
+ try {
152
+ if ( ! process . env . BUILT_IN_POSTCSS ) {
153
+ return require ( 'postcss' )
154
+ }
155
+ } catch { }
156
+
157
+ return lazyPostcss ( )
158
+ }
159
+
149
160
let commands = {
150
161
init : {
151
162
run : init ,
@@ -576,18 +587,8 @@ async function build() {
576
587
} ) ( ) ,
577
588
] . filter ( Boolean )
578
589
579
- function loadPostcss ( ) {
580
- // Try to load a local `postcss` version first
581
- try {
582
- if ( ! process . env . BUILT_IN_POSTCSS ) {
583
- return require ( 'postcss' )
584
- }
585
- } catch { }
586
-
587
- return lazyPostcss ( )
588
- }
589
-
590
- let processor = loadPostcss ( ) ( plugins )
590
+ let postcss = loadPostcss ( )
591
+ let processor = postcss ( plugins )
591
592
592
593
function processCSS ( css ) {
593
594
let start = process . hrtime . bigint ( )
@@ -720,6 +721,7 @@ async function build() {
720
721
let tailwindPluginIdx = plugins . indexOf ( '__TAILWIND_PLUGIN_POSITION__' )
721
722
let copy = plugins . slice ( )
722
723
copy . splice ( tailwindPluginIdx , 1 , tailwindPlugin )
724
+ let postcss = loadPostcss ( )
723
725
let processor = postcss ( copy )
724
726
725
727
function processCSS ( css ) {
You can’t perform that action at this time.
0 commit comments