UNPKG

1.78 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8import { BuilderContext } from '@angular-devkit/architect';
9import { DevServerBuildOutput, WebpackLoggingCallback } from '@angular-devkit/build-webpack';
10import { json } from '@angular-devkit/core';
11import { Observable } from 'rxjs';
12import webpack from 'webpack';
13import { ExecutionTransformer } from '../../transforms';
14import { IndexHtmlTransform } from '../../utils/index-file/index-html-generator';
15import { BuildEventStats } from '../../webpack/utils/stats';
16import { Schema } from './schema';
17export type DevServerBuilderOptions = Schema;
18/**
19 * @experimental Direct usage of this type is considered experimental.
20 */
21export type DevServerBuilderOutput = DevServerBuildOutput & {
22 baseUrl: string;
23 stats: BuildEventStats;
24};
25/**
26 * Reusable implementation of the Angular Webpack development server builder.
27 * @param options Dev Server options.
28 * @param context The build context.
29 * @param transforms A map of transforms that can be used to hook into some logic (such as
30 * transforming webpack configuration before passing it to webpack).
31 *
32 * @experimental Direct usage of this function is considered experimental.
33 */
34export declare function serveWebpackBrowser(options: DevServerBuilderOptions, context: BuilderContext, transforms?: {
35 webpackConfiguration?: ExecutionTransformer<webpack.Configuration>;
36 logging?: WebpackLoggingCallback;
37 indexHtml?: IndexHtmlTransform;
38}): Observable<DevServerBuilderOutput>;
39declare const _default: import("../../../../architect/src/internal").Builder<Schema & json.JsonObject>;
40export default _default;