/// import * as webpack from "webpack"; import { HtmlExternalOptions } from "./HtmlPlugin"; export interface CSSPath { include: string | string[]; exclude?: string | string[]; } export interface WebpackOptions { /** * 项目根目录 */ rootPath: string; /** * tsx?包含的文件目录 */ tsInclude?: string | string[]; /** * jsx?包含的文件目录 */ jsInclude?: string | string[]; /** * 项目的 entry,等价于 webpack 的 entry */ entry: webpack.Entry; /** * 和上面的 entry 一样,只是存放的是第三方库 */ dllEntry: webpack.Entry; /** * 打包的文件输出路径 */ outputPath: string; /** * 相当于 webpack 的 public path,只有在打包的时候才会用到。可传一个对象,区分 uat 和 online */ cdnPath: string | { uat: string; online: string; }; /** * 配置 css modules 路径 */ cssModulePath?: CSSPath; /** * 配置全局 css 路径 */ cssGlobalPath?: CSSPath; /** * 项目是否要生成 html 文件 */ html?: boolean; /** * 自定义 html 参数 */ htmlOption?: HtmlExternalOptions; /** * 自定义的 babel 插件 */ babelPlugins?: any[]; /** * webpack 的 externals */ externals?: { [key: string]: boolean | string; }; /** * 其他需要运行的plugins */ plugins?: any[]; /** * 禁用Common Chunks Plugin */ disableCommonChunks?: boolean; /** * 打包出来代码的version,理论上来讲可以不用传,为了应对一些js文件 modify 的缓存bug */ version?: string; /** * 静态文件复制路径,from 为绝对路径,to 为相对 outputPath 的路径 * see https://github.com/webpack-contrib/copy-webpack-plugin#pattern-properties */ copyPath?: { from: string; to?: string; }[]; } export declare function genDevConfig(options: WebpackOptions, name: string, devPort: number): any; export declare function genProdConfig(options: WebpackOptions, name: string, isOnline: boolean, analyse?: boolean): any;