UNPKG

2.29 kBTypeScriptView Raw
1/*! *****************************************************************************
2Copyright (c) JDJR Corporation. All rights reserved.
3Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4this file except in compliance with the License. You may obtain a copy of the
5License at http://www.apache.org/licenses/LICENSE-2.0
6Author: kemao 2018-11-30 10:28:12
7
8THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
9KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
10WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
11MERCHANTABLITY OR NON-INFRINGEMENT.
12
13See the Apache Version 2.0 License for specific language governing permissions
14and limitations under the License.
15***************************************************************************** */
16import { PackageTools } from "@kemao/package-tools/PackageTools/PackageTools";
17import * as webpack from "webpack";
18import { Version } from "../Core/Version";
19import { BrowserPack } from "./BrowserPack";
20export declare class ServerPack {
21 version: Version;
22 packageTools: PackageTools;
23 count: number;
24 sourceFile: any;
25 outFile: any;
26 watch: boolean;
27 compiler: any;
28 eventMap: Map<any, any>;
29 browserPack: BrowserPack;
30 sourceDir: any;
31 env: {
32 NODE_ENV: any;
33 publicPath: string;
34 };
35 /**
36 * 设置源路径
37 * @param sourceDir
38 */
39 setSourceDir(sourceDir: string): void;
40 setBrowserPack(browserPack: any): void;
41 setSourceFile(sourceFile: string): void;
42 setOutFile(outFile: string): void;
43 addEventListener(eventName: "build" | "buildStart" | "end", listener: (event: any) => void): void;
44 build(): Promise<void>;
45 setWatch(watch: boolean): void;
46 getWatch(): boolean;
47 /**
48 * 关闭监控
49 */
50 close(): void;
51 trigger(eventName: "build" | "buildStart" | "end", data?: object): Promise<void>;
52 pack(entry: any): Promise<void>;
53 setENV(env: any): void;
54 isProduction(): boolean;
55 sendMessage(messageStr: string, title?: string, icon?: "info" | "error" | "warn"): void;
56 protected webpack(config: webpack.Configuration): Promise<unknown>;
57 protected done(webpackSelfError: any, stats: any): Promise<void>;
58 private isWatch;
59}