mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-16 18:43:42 +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));
|
return from(import(webpackConfigPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected createWebpackCompiler(config: webpack.Configuration): webpack.Compiler {
|
||||||
|
return webpack(config);
|
||||||
|
}
|
||||||
|
|
||||||
public runWebpack(
|
public runWebpack(
|
||||||
config: webpack.Configuration, loggingCb = defaultLoggingCb,
|
config: webpack.Configuration, loggingCb = defaultLoggingCb,
|
||||||
): Observable<BuildEvent> {
|
): Observable<BuildEvent> {
|
||||||
return new Observable(obs => {
|
return new Observable(obs => {
|
||||||
const webpackCompiler = webpack(config);
|
const webpackCompiler = this.createWebpackCompiler(config);
|
||||||
|
|
||||||
const callback: webpack.compiler.CompilerCallback = (err, stats) => {
|
const callback: webpack.compiler.CompilerCallback = (err, stats) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user