/*************************************************** * Created by nanyuantingfeng on 2020/4/1 12:43. * ***************************************************/ import Config = require('webpack-chain') type $ElementType = T[K] interface IPatchOptions { defines: Record provides: Record externals: Record noParse: string[] htmls: Record & { ['*']?: { template?: string; favicon?: string } } vendors: [string, string[]] files: Record sdks: Record & { ['*']?: string[] } entry: Record | string imports: Array<{ libraryName: string; style: boolean; libraryDirectory?: string }> pxtorem: { rootValue: number; propWhiteList?: string[] } alias: Record } interface IPatchMixin { (options: Partial): void defines(defines: $ElementType): void provides(provides: $ElementType): void externals(externals: $ElementType): void noParse(noParse: $ElementType): void htmls(htmls: $ElementType): void vendors(vendors: $ElementType): void files(files: $ElementType): void sdks(sdks: $ElementType): void entry(entry: $ElementType): void imports(imports: $ElementType): void browserslist(browserslist: string[], compilertarget?: 'es5' | 'es6' | string[]): void pxtorem(options: $ElementType): void alias(options: $ElementType): void } interface PatchedConfig extends Config { getEntryNameAndPluginName(): { entryName: string pluginName?: string moduleName: string UniqueName: string } useClusterMaster(options: { masterId: string; injected: string }): this useClusterWorker(options: { masterId: string; workerId: string; entry?: string }): this patch: IPatchMixin } declare global { module 'whispered-build/configs' { function createConfig(): PatchedConfig export = createConfig export default createConfig } module 'whispered-build/webpack.entry.config' { const config: PatchedConfig export = config export default config } module 'whispered-build/webpack.entry.dev.config' { const config: PatchedConfig export = config export default config } module 'whispered-build/webpack.entry.pro.config' { const config: PatchedConfig export = config export default config } module 'whispered-build/webpack.plugin.config' { const config: PatchedConfig export = config export default config } module 'whispered-build/webpack.plugin.dev.config' { const config: PatchedConfig export = config export default config } module 'whispered-build/webpack.plugin.pro.config' { const config: PatchedConfig export = config export default config } module 'whispered-build/webpack.simple.config' { const config: PatchedConfig export = config export default config } module 'whispered-build/webpack.simple.dev.config' { const config: PatchedConfig export = config export default config } module 'whispered-build/webpack.simple.pro.config' { const config: PatchedConfig export = config export default config } }