plugin-light
Version:
Webpack 相关插件、Loader、基础配置及 CLI 命令
109 lines (103 loc) • 2.96 kB
TypeScript
import * as workbox_webpack_plugin_build_generate_sw from 'workbox-webpack-plugin/build/generate-sw';
type IBaseConfigOptions = {
port?: number;
https?: boolean;
isUseVueLoader?: boolean;
isVue3?: boolean;
useXSS?: boolean;
useIfDefLoader?: boolean;
handleIfDefFiles?: Array<string>;
terserPureFuncs?: Array<string>;
transpileDependencies?: Array<string>;
shadowProjectMap?: Record<string, string>;
customCdnUrls?: Array<string>;
usePMDBusinessAlias?: boolean;
useWorkBoxPlugin?: {};
lessAlias?: boolean;
};
declare function getWebpackBaseConfig(options?: IBaseConfigOptions): {
publicPath: string | undefined;
outputDir: string;
assetsDir: string;
lintOnSave: boolean;
productionSourceMap: boolean;
transpileDependencies: string[];
parallel: boolean;
css: {
extract: boolean;
};
devServer: {
port: string | number;
https: boolean;
proxy: {
'/pvp/share/getsharecfg': {
target: string;
changeOrigin: boolean;
ws: boolean;
};
'/pvp/share/gethash': {
target: string;
changeOrigin: boolean;
ws: boolean;
};
};
disableHostCheck: boolean;
};
configureWebpack: {
plugins: (workbox_webpack_plugin_build_generate_sw.GenerateSW | undefined)[];
optimization?: {
minimize: boolean;
} | undefined;
entry: string;
name: string;
resolve: {
alias: Record<string, string>;
extensions: string[];
};
};
chainWebpack(config: any): void;
};
declare function innerPublish(publishEnv: string): void;
declare const WEBPACK_BASE_CONFIG: {
publicPath: string | undefined;
outputDir: string;
assetsDir: string;
lintOnSave: boolean;
productionSourceMap: boolean;
transpileDependencies: string[];
parallel: boolean;
css: {
extract: boolean;
};
devServer: {
port: string | number;
https: boolean;
proxy: {
'/pvp/share/getsharecfg': {
target: string;
changeOrigin: boolean;
ws: boolean;
};
'/pvp/share/gethash': {
target: string;
changeOrigin: boolean;
ws: boolean;
};
};
disableHostCheck: boolean;
};
configureWebpack: {
plugins: (workbox_webpack_plugin_build_generate_sw.GenerateSW | undefined)[];
optimization?: {
minimize: boolean;
} | undefined;
entry: string;
name: string;
resolve: {
alias: Record<string, string>;
extensions: string[];
};
};
chainWebpack(config: any): void;
};
export { WEBPACK_BASE_CONFIG, getWebpackBaseConfig, innerPublish };