Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(web): fix(web): allow use multiple config in custom webpack confi…
…guration file (#9188)

When use a custom configuration file for webpack build target allow to run webpack with
multiple
configuration options.
ISSUES CLOSED: #9186
  • Loading branch information
sidmonta committed Mar 10, 2022
1 parent 5cebe9c commit 37278fd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/web/src/executors/webpack/webpack.impl.ts
@@ -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';
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit 37278fd

Please sign in to comment.