Skip to content

Commit 43592e0

Browse files
clydindgp1130
authored andcommitted
fix(@angular-devkit/build-angular): ensure build-angular's webpack version is used
(cherry picked from commit f3a23fc)
1 parent 1cf48a5 commit 43592e0

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

packages/angular_devkit/build_angular/src/browser/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { join, json, logging, normalize, tags, virtualFs } from '@angular-devkit
1111
import { NodeJsSyncHost } from '@angular-devkit/core/node';
1212
import * as fs from 'fs';
1313
import * as path from 'path';
14-
import { Observable, from, of } from 'rxjs';
14+
import { Observable, from } from 'rxjs';
1515
import { concatMap, map, switchMap } from 'rxjs/operators';
1616
import { ScriptTarget } from 'typescript';
1717
import * as webpack from 'webpack';
@@ -256,6 +256,7 @@ export function buildWebpackBrowser(
256256
const startTime = Date.now();
257257

258258
return runWebpack(config, context, {
259+
webpackFactory: require('webpack') as typeof webpack,
259260
logging:
260261
transforms.logging ||
261262
(useBundleDownleveling

packages/angular_devkit/build_angular/src/extract-i18n/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ async function execute(options: ExtractI18nBuilderOptions, context: BuilderConte
131131
}
132132
};
133133

134-
return runWebpack(config, context, { logging }).toPromise();
134+
return runWebpack(config, context, {
135+
logging,
136+
webpackFactory: await import('webpack'),
137+
}).toPromise();
135138
}
136139

137140
export default createBuilder<JsonObject & ExtractI18nBuilderOptions>(execute);

packages/angular_devkit/build_angular/src/server/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ export function execute(
6161

6262
return from(initialize(options, context, transforms.webpackConfiguration)).pipe(
6363
concatMap(({ config, i18n }) => {
64-
return runWebpack(config, context).pipe(
64+
return runWebpack(config, context, {
65+
webpackFactory: require('webpack') as typeof webpack,
66+
}).pipe(
6567
concatMap(async output => {
6668
const { emittedFiles = [], webpackStats } = output;
6769
if (!output.success || !i18n.shouldInline) {

0 commit comments

Comments
 (0)