fix(web): fix(web): allow use multiple config in custom webpack configuration file (#9188)

When use a custom configuration file for webpack build target allow to run webpack with
multiple
configuration options.
ISSUES CLOSED: #9186
This commit is contained in:
Sid monta 2022-03-10 16:16:04 +01:00 committed by GitHub
parent 5cebe9ccdd
commit 37278fdece
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,13 @@
import { ExecutorContext, logger } from '@nrwl/devkit';
import type { Configuration, Stats } from 'webpack';
import { from, of } from 'rxjs';
import { bufferCount, mergeScan, switchMap, tap } from 'rxjs/operators';
import {
bufferCount,
mergeScan,
switchMap,
tap,
mergeMap,
} from 'rxjs/operators';
import { eachValueFrom } from 'rxjs-for-await';
import { execSync } from 'child_process';
import { Range, satisfies } from 'semver';
@ -188,6 +194,7 @@ export async function* run(
const configs = getWebpackConfigs(options, context);
return yield* eachValueFrom(
from(configs).pipe(
mergeMap((config) => (Array.isArray(config) ? from(config) : of(config))),
// Run build sequentially and bail when first one fails.
mergeScan(
(acc, config) => {