@@ -415,7 +415,7 @@ async function build() {
415415
416416 async function loadPostCssPlugins ( ) {
417417 let customPostCssPath = typeof args [ '--postcss' ] === 'string' ? args [ '--postcss' ] : undefined
418- let { plugins : configPlugins } = customPostCssPath
418+ let config = customPostCssPath
419419 ? await ( async ( ) => {
420420 let file = path . resolve ( customPostCssPath )
421421
@@ -431,10 +431,14 @@ async function build() {
431431 config . plugins = [ ]
432432 }
433433
434- return { plugins : loadPlugins ( config , file ) }
434+ let { plugins, ...options } = config
435+
436+ return { options, plugins : loadPlugins ( config , file ) }
435437 } ) ( )
436438 : await postcssrc ( )
437439
440+ let configPlugins = config . plugins
441+
438442 let configPluginTailwindIdx = configPlugins . findIndex ( ( plugin ) => {
439443 if ( typeof plugin === 'function' && plugin . name === 'tailwindcss' ) {
440444 return true
@@ -454,7 +458,7 @@ async function build() {
454458 ? configPlugins
455459 : configPlugins . slice ( configPluginTailwindIdx + 1 )
456460
457- return [ beforePlugins , afterPlugins ]
461+ return [ beforePlugins , afterPlugins , config . options ]
458462 }
459463
460464 function resolveConfig ( ) {
@@ -538,7 +542,7 @@ async function build() {
538542
539543 tailwindPlugin . postcss = true
540544
541- let [ beforePlugins , afterPlugins ] = includePostCss ? await loadPostCssPlugins ( ) : [ [ ] , [ ] ]
545+ let [ beforePlugins , afterPlugins , postcssOptions ] = includePostCss ? await loadPostCssPlugins ( ) : [ [ ] , [ ] , { } ]
542546
543547 let plugins = [
544548 ...beforePlugins ,
@@ -573,7 +577,7 @@ async function build() {
573577 let start = process . hrtime . bigint ( )
574578 return Promise . resolve ( )
575579 . then ( ( ) => ( output ? fs . promises . mkdir ( path . dirname ( output ) , { recursive : true } ) : null ) )
576- . then ( ( ) => processor . process ( css , { from : input , to : output } ) )
580+ . then ( ( ) => processor . process ( css , { ... postcssOptions , from : input , to : output } ) )
577581 . then ( ( result ) => {
578582 if ( ! output ) {
579583 return process . stdout . write ( result . css )
0 commit comments