|
6 | 6 | * found in the LICENSE file at https://angular.dev/license
|
7 | 7 | */
|
8 | 8 |
|
9 |
| -import { BuilderContext, createBuilder } from '@angular-devkit/architect'; |
| 9 | +import { Builder, BuilderContext, createBuilder } from '@angular-devkit/architect'; |
| 10 | +import { json } from '@angular-devkit/core'; |
10 | 11 | import { resolve as pathResolve } from 'path';
|
11 | 12 | import { Observable, from, isObservable, of, switchMap } from 'rxjs';
|
12 | 13 | import webpack from 'webpack';
|
@@ -124,12 +125,15 @@ export function runWebpackDevServer(
|
124 | 125 | );
|
125 | 126 | }
|
126 | 127 |
|
127 |
| -export default createBuilder<WebpackDevServerBuilderSchema, DevServerBuildOutput>( |
128 |
| - (options, context) => { |
129 |
| - const configPath = pathResolve(context.workspaceRoot, options.webpackConfig); |
| 128 | +const builder: Builder<WebpackDevServerBuilderSchema & json.JsonObject> = createBuilder< |
| 129 | + WebpackDevServerBuilderSchema, |
| 130 | + DevServerBuildOutput |
| 131 | +>((options, context) => { |
| 132 | + const configPath = pathResolve(context.workspaceRoot, options.webpackConfig); |
130 | 133 |
|
131 |
| - return from(getWebpackConfig(configPath)).pipe( |
132 |
| - switchMap((config) => runWebpackDevServer(config, context)), |
133 |
| - ); |
134 |
| - }, |
135 |
| -); |
| 134 | + return from(getWebpackConfig(configPath)).pipe( |
| 135 | + switchMap((config) => runWebpackDevServer(config, context)), |
| 136 | + ); |
| 137 | +}); |
| 138 | + |
| 139 | +export default builder; |
0 commit comments