UNPKG

3.33 kBTypeScriptView Raw
1/// <reference types="webpack" />
2/// <reference types="minimist" />
3import * as webpack from 'webpack';
4import * as minimist from 'minimist';
5import { AngularCompilerPlugin, AngularCompilerPluginOptions } from '@ngtools/webpack';
6import { NgcWebpackPlugin } from '../plugin';
7import { ParsedDiagnostics } from './util';
8export declare function findPluginIndex(plugins: any[], type: any): number;
9export declare function getPluginMeta(plugins: any[]): {
10 idx: number;
11 instance: AngularCompilerPlugin | NgcWebpackPlugin;
12 options: AngularCompilerPluginOptions;
13};
14/**
15 * Run `ngc-webpack` in library mode. (i.e. run `ngc`)
16 * In Library mode compilation and output is done per module and no bundling is done.
17 * Webpack is used for resource compilation through it's loader chain but does not bundle anything.
18 * The webpack configuration, excluding loaders, has no effect.
19 * The webpack configuration must include a plugin instance (either NgcWebpackPlugin / AngularCompilerPlugin).
20 *
21 * Library mode configuration is done mainly from the `tsconfig` json file.
22 *
23 * `tsconfig` json path is taken from the options of NgcWebpackPlugin / AngularCompilerPlugin
24 *
25 * @param webpackConfig Webpack configuration module, object or string
26 */
27export declare function runCli(webpackConfig: string | webpack.Configuration): Promise<ParsedDiagnostics>;
28/**
29 * Run `ngc-webpack` in library mode. (i.e. run `ngc`)
30 * In Library mode compilation and output is done per module and no bundling is done.
31 * Webpack is used for resource compilation through it's loader chain but does not bundle anything.
32 * The webpack configuration, excluding loaders, has no effect.
33 * The webpack configuration must include a plugin instance (either NgcWebpackPlugin / AngularCompilerPlugin).
34 *
35 * Library mode configuration is done mainly from the `tsconfig` json file.
36 *
37 * `tsconfig` json path is taken from cli parameters (-p or --project) or, if not exists the options of
38 * NgcWebpackPlugin / AngularCompilerPlugin
39 *
40 * @param webpackConfig Webpack configuration module, object or string,
41 * @param cliParams cli Parameters, parsedArgs is not mandatory
42 */
43export declare function runCli(webpackConfig: string | webpack.Configuration, cliParams: {
44 args: string[];
45 parsedArgs?: minimist.ParsedArgs;
46}): Promise<ParsedDiagnostics>;
47/**
48 * Run `ngc-webpack` in library mode. (i.e. run `ngc`)
49 * In Library mode compilation and output is done per module and no bundling is done.
50 * Webpack is used for resource compilation through it's loader chain but does not bundle anything.
51 * The webpack configuration, excluding loaders, has no effect.
52 * The webpack configuration must include a plugin instance (either NgcWebpackPlugin / AngularCompilerPlugin).
53 *
54 * Library mode configuration is done mainly from the `tsconfig` json file.
55 *
56 * `tsconfig` json path is taken from the supplied tsConfigPath parameter.
57 *
58 * @param webpackConfig Webpack configuration module, object or string,
59 * @param tsConfigPath path to the tsconfig file, relative to process.cwd()
60 * @param cliParams cli Parameters, parsedArgs is not mandatory
61 */
62export declare function runCli(webpackConfig: string | webpack.Configuration, tsConfigPath: string, cliParams?: {
63 args: string[];
64 parsedArgs?: minimist.ParsedArgs;
65}): Promise<ParsedDiagnostics>;