UNPKG

1.28 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.dev/license
7 */
8import { Builder, BuilderContext, BuilderOutput } from '@angular-devkit/architect';
9import { json } from '@angular-devkit/core';
10import { Observable } from 'rxjs';
11import webpack from 'webpack';
12import { EmittedFiles } from '../../utils';
13import { Schema as RealWebpackBuilderSchema } from './schema';
14export type WebpackBuilderSchema = RealWebpackBuilderSchema;
15export interface WebpackLoggingCallback {
16 (stats: webpack.Stats, config: webpack.Configuration): void;
17}
18export interface WebpackFactory {
19 (config: webpack.Configuration): Observable<webpack.Compiler> | webpack.Compiler;
20}
21export type BuildResult = BuilderOutput & {
22 emittedFiles?: EmittedFiles[];
23 webpackStats?: webpack.StatsCompilation;
24 outputPath: string;
25};
26export declare function runWebpack(config: webpack.Configuration, context: BuilderContext, options?: {
27 logging?: WebpackLoggingCallback;
28 webpackFactory?: WebpackFactory;
29 shouldProvideStats?: boolean;
30}): Observable<BuildResult>;
31declare const builder: Builder<WebpackBuilderSchema & json.JsonObject>;
32export default builder;