feat(@angular-devkit/build-webpack): add factory for creating webpack compiler

This commit is contained in:
ManfredSteyer 2019-01-01 21:10:43 +01:00 committed by Alex Eagle
parent dcc53d00cc
commit b2c9e46fa9

View File

@ -42,11 +42,15 @@ export class WebpackBuilder implements Builder<WebpackBuilderSchema> {
return from(import(webpackConfigPath));
}
protected createWebpackCompiler(config: webpack.Configuration): webpack.Compiler {
return webpack(config);
}
public runWebpack(
config: webpack.Configuration, loggingCb = defaultLoggingCb,
): Observable<BuildEvent> {
return new Observable(obs => {
const webpackCompiler = webpack(config);
const webpackCompiler = this.createWebpackCompiler(config);
const callback: webpack.compiler.CompilerCallback = (err, stats) => {
if (err) {