mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-16 02:24:10 +08:00
feat(@angular-devkit/build-webpack): add factory for creating webpack compiler
This commit is contained in:
parent
dcc53d00cc
commit
b2c9e46fa9
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user