@@ -127,26 +127,28 @@ export function qwikRollup(qwikRollupOpts: QwikRollupPluginOptions = {}): any {
127127 return rollupPlugin ;
128128}
129129
130- export function normalizeRollupOutputOptions (
130+ export async function normalizeRollupOutputOptions (
131131 qwikPlugin : QwikPlugin ,
132132 rollupOutputOpts : Rollup . OutputOptions | Rollup . OutputOptions [ ] | undefined ,
133133 useAssetsDir : boolean ,
134134 outDir ?: string
135- ) : Rollup . OutputOptions | Rollup . OutputOptions [ ] {
135+ ) : Promise < Rollup . OutputOptions | Rollup . OutputOptions [ ] > {
136136 if ( Array . isArray ( rollupOutputOpts ) ) {
137137 // make sure at least one output is present in every case
138138 if ( ! rollupOutputOpts . length ) {
139139 rollupOutputOpts . push ( { } ) ;
140140 }
141141
142- return rollupOutputOpts . map ( ( outputOptsObj ) => ( {
143- ...normalizeRollupOutputOptionsObject ( qwikPlugin , outputOptsObj , useAssetsDir ) ,
144- dir : outDir || outputOptsObj . dir ,
145- } ) ) ;
142+ return await Promise . all (
143+ rollupOutputOpts . map ( async ( outputOptsObj ) => ( {
144+ ...( await normalizeRollupOutputOptionsObject ( qwikPlugin , outputOptsObj , useAssetsDir ) ) ,
145+ dir : outDir || outputOptsObj . dir ,
146+ } ) )
147+ ) ;
146148 }
147149
148150 return {
149- ...normalizeRollupOutputOptionsObject ( qwikPlugin , rollupOutputOpts , useAssetsDir ) ,
151+ ...( await normalizeRollupOutputOptionsObject ( qwikPlugin , rollupOutputOpts , useAssetsDir ) ) ,
150152 dir : outDir || rollupOutputOpts ?. dir ,
151153 } ;
152154}
0 commit comments