types.d.ts 328 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099
  1. /*
  2. * This file was automatically generated.
  3. * DO NOT MODIFY BY HAND.
  4. * Run `yarn special-lint-fix` to update
  5. */
  6. import { Buffer } from "buffer";
  7. import {
  8. ArrayExpression,
  9. ArrayPattern,
  10. ArrowFunctionExpression,
  11. AssignmentExpression,
  12. AssignmentPattern,
  13. AssignmentProperty,
  14. AwaitExpression,
  15. BigIntLiteral,
  16. BinaryExpression,
  17. BlockStatement,
  18. BreakStatement,
  19. CatchClause,
  20. ChainExpression,
  21. ClassBody,
  22. ClassDeclaration,
  23. ClassExpression,
  24. Comment,
  25. ConditionalExpression,
  26. ContinueStatement,
  27. DebuggerStatement,
  28. DoWhileStatement,
  29. EmptyStatement,
  30. ExportAllDeclaration,
  31. ExportDefaultDeclaration,
  32. ExportNamedDeclaration,
  33. ExportSpecifier,
  34. ExpressionStatement,
  35. ForInStatement,
  36. ForOfStatement,
  37. ForStatement,
  38. FunctionDeclaration,
  39. FunctionExpression,
  40. Identifier,
  41. IfStatement,
  42. ImportDeclaration,
  43. ImportDefaultSpecifier,
  44. ImportExpression,
  45. ImportNamespaceSpecifier,
  46. ImportSpecifier,
  47. LabeledStatement,
  48. LogicalExpression,
  49. MemberExpression,
  50. MetaProperty,
  51. MethodDefinition,
  52. NewExpression,
  53. ObjectExpression,
  54. ObjectPattern,
  55. PrivateIdentifier,
  56. Program,
  57. Property,
  58. PropertyDefinition,
  59. RegExpLiteral,
  60. RestElement,
  61. ReturnStatement,
  62. SequenceExpression,
  63. SimpleCallExpression,
  64. SimpleLiteral,
  65. SpreadElement,
  66. StaticBlock,
  67. Super,
  68. SwitchCase,
  69. SwitchStatement,
  70. TaggedTemplateExpression,
  71. TemplateElement,
  72. TemplateLiteral,
  73. ThisExpression,
  74. ThrowStatement,
  75. TryStatement,
  76. UnaryExpression,
  77. UpdateExpression,
  78. VariableDeclaration,
  79. VariableDeclarator,
  80. WhileStatement,
  81. WithStatement,
  82. YieldExpression
  83. } from "estree";
  84. import { ServerOptions as ServerOptionsImport } from "http";
  85. import { ListenOptions, Server } from "net";
  86. import { validate as validateFunction } from "schema-utils";
  87. import { default as ValidationError } from "schema-utils/declarations/ValidationError";
  88. import { ValidationErrorConfiguration } from "schema-utils/declarations/validate";
  89. import {
  90. AsArray,
  91. AsyncParallelHook,
  92. AsyncSeriesBailHook,
  93. AsyncSeriesHook,
  94. AsyncSeriesWaterfallHook,
  95. HookMap,
  96. MultiHook,
  97. SyncBailHook,
  98. SyncHook,
  99. SyncWaterfallHook
  100. } from "tapable";
  101. import { SecureContextOptions, TlsOptions } from "tls";
  102. declare class AbstractLibraryPlugin<T> {
  103. constructor(__0: {
  104. /**
  105. * name of the plugin
  106. */
  107. pluginName: string;
  108. /**
  109. * used library type
  110. */
  111. type: string;
  112. });
  113. /**
  114. * Apply the plugin
  115. */
  116. apply(compiler: Compiler): void;
  117. parseOptions(library: LibraryOptions): false | T;
  118. finishEntryModule(
  119. module: Module,
  120. entryName: string,
  121. libraryContext: LibraryContext<T>
  122. ): void;
  123. embedInRuntimeBailout(
  124. module: Module,
  125. renderContext: RenderContext,
  126. libraryContext: LibraryContext<T>
  127. ): undefined | string;
  128. strictRuntimeBailout(
  129. renderContext: RenderContext,
  130. libraryContext: LibraryContext<T>
  131. ): undefined | string;
  132. runtimeRequirements(
  133. chunk: Chunk,
  134. set: Set<string>,
  135. libraryContext: LibraryContext<T>
  136. ): void;
  137. render(
  138. source: Source,
  139. renderContext: RenderContext,
  140. libraryContext: LibraryContext<T>
  141. ): Source;
  142. renderStartup(
  143. source: Source,
  144. module: Module,
  145. renderContext: StartupRenderContext,
  146. libraryContext: LibraryContext<T>
  147. ): Source;
  148. chunkHash(
  149. chunk: Chunk,
  150. hash: Hash,
  151. chunkHashContext: ChunkHashContext,
  152. libraryContext: LibraryContext<T>
  153. ): void;
  154. static COMMON_LIBRARY_NAME_MESSAGE: string;
  155. }
  156. declare interface AdditionalData {
  157. [index: string]: any;
  158. webpackAST: object;
  159. }
  160. declare class AggressiveMergingPlugin {
  161. constructor(options?: any);
  162. options: any;
  163. /**
  164. * Apply the plugin
  165. */
  166. apply(compiler: Compiler): void;
  167. }
  168. declare class AggressiveSplittingPlugin {
  169. constructor(options?: AggressiveSplittingPluginOptions);
  170. options: AggressiveSplittingPluginOptions;
  171. /**
  172. * Apply the plugin
  173. */
  174. apply(compiler: Compiler): void;
  175. static wasChunkRecorded(chunk: Chunk): boolean;
  176. }
  177. declare interface AggressiveSplittingPluginOptions {
  178. /**
  179. * Extra cost for each chunk (Default: 9.8kiB).
  180. */
  181. chunkOverhead?: number;
  182. /**
  183. * Extra cost multiplicator for entry chunks (Default: 10).
  184. */
  185. entryChunkMultiplicator?: number;
  186. /**
  187. * Byte, max size of per file (Default: 50kiB).
  188. */
  189. maxSize?: number;
  190. /**
  191. * Byte, split point. (Default: 30kiB).
  192. */
  193. minSize?: number;
  194. }
  195. declare interface AliasOption {
  196. alias: string | false | string[];
  197. name: string;
  198. onlyModule?: boolean;
  199. }
  200. type AliasOptionNewRequest = string | false | string[];
  201. declare interface AliasOptions {
  202. [index: string]: AliasOptionNewRequest;
  203. }
  204. declare interface Argument {
  205. description: string;
  206. simpleType: "string" | "number" | "boolean";
  207. multiple: boolean;
  208. configs: ArgumentConfig[];
  209. }
  210. declare interface ArgumentConfig {
  211. description: string;
  212. negatedDescription?: string;
  213. path: string;
  214. multiple: boolean;
  215. type: "string" | "number" | "boolean" | "path" | "enum" | "RegExp" | "reset";
  216. values?: any[];
  217. }
  218. declare interface Asset {
  219. /**
  220. * the filename of the asset
  221. */
  222. name: string;
  223. /**
  224. * source of the asset
  225. */
  226. source: Source;
  227. /**
  228. * info about the asset
  229. */
  230. info: AssetInfo;
  231. }
  232. declare interface AssetEmittedInfo {
  233. content: Buffer;
  234. source: Source;
  235. compilation: Compilation;
  236. outputPath: string;
  237. targetPath: string;
  238. }
  239. type AssetFilterItemTypes =
  240. | string
  241. | RegExp
  242. | ((name: string, asset: StatsAsset) => boolean);
  243. /**
  244. * Options object for data url generation.
  245. */
  246. declare interface AssetGeneratorDataUrlOptions {
  247. /**
  248. * Asset encoding (defaults to base64).
  249. */
  250. encoding?: false | "base64";
  251. /**
  252. * Asset mimetype (getting from file extension by default).
  253. */
  254. mimetype?: string;
  255. }
  256. type AssetGeneratorOptions = AssetInlineGeneratorOptions &
  257. AssetResourceGeneratorOptions;
  258. type AssetInfo = KnownAssetInfo & Record<string, any>;
  259. /**
  260. * Generator options for asset/inline modules.
  261. */
  262. declare interface AssetInlineGeneratorOptions {
  263. /**
  264. * The options for data url generator.
  265. */
  266. dataUrl?:
  267. | AssetGeneratorDataUrlOptions
  268. | ((
  269. source: string | Buffer,
  270. context: { filename: string; module: Module }
  271. ) => string);
  272. }
  273. /**
  274. * Options object for DataUrl condition.
  275. */
  276. declare interface AssetParserDataUrlOptions {
  277. /**
  278. * Maximum size of asset that should be inline as modules. Default: 8kb.
  279. */
  280. maxSize?: number;
  281. }
  282. /**
  283. * Parser options for asset modules.
  284. */
  285. declare interface AssetParserOptions {
  286. /**
  287. * The condition for inlining the asset as DataUrl.
  288. */
  289. dataUrlCondition?:
  290. | AssetParserDataUrlOptions
  291. | ((
  292. source: string | Buffer,
  293. context: { filename: string; module: Module }
  294. ) => boolean);
  295. }
  296. /**
  297. * Generator options for asset/resource modules.
  298. */
  299. declare interface AssetResourceGeneratorOptions {
  300. /**
  301. * Emit an output asset from this asset module. This can be set to 'false' to omit emitting e. g. for SSR.
  302. */
  303. emit?: boolean;
  304. /**
  305. * Specifies the filename template of output files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
  306. */
  307. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  308. /**
  309. * Emit the asset in the specified folder relative to 'output.path'. This should only be needed when custom 'publicPath' is specified to match the folder structure there.
  310. */
  311. outputPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  312. /**
  313. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  314. */
  315. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  316. }
  317. declare class AsyncDependenciesBlock extends DependenciesBlock {
  318. constructor(
  319. groupOptions: RawChunkGroupOptions & { name?: string } & {
  320. entryOptions?: EntryOptions;
  321. },
  322. loc?: SyntheticDependencyLocation | RealDependencyLocation,
  323. request?: string
  324. );
  325. groupOptions: RawChunkGroupOptions & { name?: string } & {
  326. entryOptions?: EntryOptions;
  327. };
  328. loc?: SyntheticDependencyLocation | RealDependencyLocation;
  329. request?: string;
  330. chunkName: string;
  331. module: any;
  332. }
  333. declare abstract class AsyncQueue<T, K, R> {
  334. hooks: {
  335. beforeAdd: AsyncSeriesHook<[T]>;
  336. added: SyncHook<[T]>;
  337. beforeStart: AsyncSeriesHook<[T]>;
  338. started: SyncHook<[T]>;
  339. result: SyncHook<[T, Error, R]>;
  340. };
  341. add(item: T, callback: CallbackAsyncQueue<R>): void;
  342. invalidate(item: T): void;
  343. /**
  344. * Waits for an already started item
  345. */
  346. waitFor(item: T, callback: CallbackAsyncQueue<R>): void;
  347. stop(): void;
  348. increaseParallelism(): void;
  349. decreaseParallelism(): void;
  350. isProcessing(item: T): boolean;
  351. isQueued(item: T): boolean;
  352. isDone(item: T): boolean;
  353. clear(): void;
  354. }
  355. declare class AsyncWebAssemblyModulesPlugin {
  356. constructor(options?: any);
  357. options: any;
  358. /**
  359. * Apply the plugin
  360. */
  361. apply(compiler: Compiler): void;
  362. renderModule(module?: any, renderContext?: any, hooks?: any): any;
  363. static getCompilationHooks(
  364. compilation: Compilation
  365. ): CompilationHooksAsyncWebAssemblyModulesPlugin;
  366. }
  367. declare class AutomaticPrefetchPlugin {
  368. constructor();
  369. /**
  370. * Apply the plugin
  371. */
  372. apply(compiler: Compiler): void;
  373. }
  374. type AuxiliaryComment = string | LibraryCustomUmdCommentObject;
  375. declare interface BackendApi {
  376. dispose: (arg0?: Error) => void;
  377. module: (arg0: Module) => { client: string; data: string; active: boolean };
  378. }
  379. declare class BannerPlugin {
  380. constructor(options: BannerPluginArgument);
  381. options: BannerPluginOptions;
  382. banner: (data: { hash: string; chunk: Chunk; filename: string }) => string;
  383. /**
  384. * Apply the plugin
  385. */
  386. apply(compiler: Compiler): void;
  387. }
  388. type BannerPluginArgument =
  389. | string
  390. | BannerPluginOptions
  391. | ((data: { hash: string; chunk: Chunk; filename: string }) => string);
  392. declare interface BannerPluginOptions {
  393. /**
  394. * Specifies the banner.
  395. */
  396. banner:
  397. | string
  398. | ((data: { hash: string; chunk: Chunk; filename: string }) => string);
  399. /**
  400. * If true, the banner will only be added to the entry chunks.
  401. */
  402. entryOnly?: boolean;
  403. /**
  404. * Exclude all modules matching any of these conditions.
  405. */
  406. exclude?: string | RegExp | Rule[];
  407. /**
  408. * If true, banner will be placed at the end of the output.
  409. */
  410. footer?: boolean;
  411. /**
  412. * Include all modules matching any of these conditions.
  413. */
  414. include?: string | RegExp | Rule[];
  415. /**
  416. * If true, banner will not be wrapped in a comment.
  417. */
  418. raw?: boolean;
  419. /**
  420. * Include all modules that pass test assertion.
  421. */
  422. test?: string | RegExp | Rule[];
  423. }
  424. declare interface BaseResolveRequest {
  425. path: string | false;
  426. descriptionFilePath?: string;
  427. descriptionFileRoot?: string;
  428. descriptionFileData?: object;
  429. relativePath?: string;
  430. ignoreSymlinks?: boolean;
  431. fullySpecified?: boolean;
  432. }
  433. declare abstract class BasicEvaluatedExpression {
  434. type: number;
  435. range: [number, number];
  436. falsy: boolean;
  437. truthy: boolean;
  438. nullish?: boolean;
  439. sideEffects: boolean;
  440. bool?: boolean;
  441. number?: number;
  442. bigint?: bigint;
  443. regExp?: RegExp;
  444. string?: string;
  445. quasis?: BasicEvaluatedExpression[];
  446. parts?: BasicEvaluatedExpression[];
  447. array?: any[];
  448. items?: BasicEvaluatedExpression[];
  449. options?: BasicEvaluatedExpression[];
  450. prefix?: BasicEvaluatedExpression;
  451. postfix?: BasicEvaluatedExpression;
  452. wrappedInnerExpressions: any;
  453. identifier?: string | VariableInfoInterface;
  454. rootInfo: VariableInfoInterface;
  455. getMembers: () => string[];
  456. getMembersOptionals: () => boolean[];
  457. expression: NodeEstreeIndex;
  458. isUnknown(): boolean;
  459. isNull(): boolean;
  460. isUndefined(): boolean;
  461. isString(): boolean;
  462. isNumber(): boolean;
  463. isBigInt(): boolean;
  464. isBoolean(): boolean;
  465. isRegExp(): boolean;
  466. isConditional(): boolean;
  467. isArray(): boolean;
  468. isConstArray(): boolean;
  469. isIdentifier(): boolean;
  470. isWrapped(): boolean;
  471. isTemplateString(): boolean;
  472. /**
  473. * Is expression a primitive or an object type value?
  474. */
  475. isPrimitiveType(): undefined | boolean;
  476. /**
  477. * Is expression a runtime or compile-time value?
  478. */
  479. isCompileTimeValue(): boolean;
  480. /**
  481. * Gets the compile-time value of the expression
  482. */
  483. asCompileTimeValue(): any;
  484. isTruthy(): boolean;
  485. isFalsy(): boolean;
  486. isNullish(): undefined | boolean;
  487. /**
  488. * Can this expression have side effects?
  489. */
  490. couldHaveSideEffects(): boolean;
  491. asBool(): any;
  492. asNullish(): undefined | boolean;
  493. asString(): any;
  494. setString(string?: any): BasicEvaluatedExpression;
  495. setUndefined(): BasicEvaluatedExpression;
  496. setNull(): BasicEvaluatedExpression;
  497. setNumber(number?: any): BasicEvaluatedExpression;
  498. setBigInt(bigint?: any): BasicEvaluatedExpression;
  499. setBoolean(bool?: any): BasicEvaluatedExpression;
  500. setRegExp(regExp?: any): BasicEvaluatedExpression;
  501. setIdentifier(
  502. identifier?: any,
  503. rootInfo?: any,
  504. getMembers?: any,
  505. getMembersOptionals?: any
  506. ): BasicEvaluatedExpression;
  507. setWrapped(
  508. prefix?: any,
  509. postfix?: any,
  510. innerExpressions?: any
  511. ): BasicEvaluatedExpression;
  512. setOptions(options?: any): BasicEvaluatedExpression;
  513. addOptions(options?: any): BasicEvaluatedExpression;
  514. setItems(items?: any): BasicEvaluatedExpression;
  515. setArray(array?: any): BasicEvaluatedExpression;
  516. setTemplateString(
  517. quasis?: any,
  518. parts?: any,
  519. kind?: any
  520. ): BasicEvaluatedExpression;
  521. templateStringKind: any;
  522. setTruthy(): BasicEvaluatedExpression;
  523. setFalsy(): BasicEvaluatedExpression;
  524. setNullish(value?: any): BasicEvaluatedExpression;
  525. setRange(range?: any): BasicEvaluatedExpression;
  526. setSideEffects(sideEffects?: boolean): BasicEvaluatedExpression;
  527. setExpression(expression?: any): BasicEvaluatedExpression;
  528. }
  529. type BuildMeta = KnownBuildMeta & Record<string, any>;
  530. declare abstract class ByTypeGenerator extends Generator {
  531. map: any;
  532. }
  533. declare const CIRCULAR_CONNECTION: unique symbol;
  534. declare class Cache {
  535. constructor();
  536. hooks: {
  537. get: AsyncSeriesBailHook<
  538. [
  539. string,
  540. null | Etag,
  541. ((result: any, callback: (arg0?: Error) => void) => void)[]
  542. ],
  543. any
  544. >;
  545. store: AsyncParallelHook<[string, null | Etag, any]>;
  546. storeBuildDependencies: AsyncParallelHook<[Iterable<string>]>;
  547. beginIdle: SyncHook<[]>;
  548. endIdle: AsyncParallelHook<[]>;
  549. shutdown: AsyncParallelHook<[]>;
  550. };
  551. get<T>(
  552. identifier: string,
  553. etag: null | Etag,
  554. callback: CallbackCache<T>
  555. ): void;
  556. store<T>(
  557. identifier: string,
  558. etag: null | Etag,
  559. data: T,
  560. callback: CallbackCache<void>
  561. ): void;
  562. /**
  563. * After this method has succeeded the cache can only be restored when build dependencies are
  564. */
  565. storeBuildDependencies(
  566. dependencies: Iterable<string>,
  567. callback: CallbackCache<void>
  568. ): void;
  569. beginIdle(): void;
  570. endIdle(callback: CallbackCache<void>): void;
  571. shutdown(callback: CallbackCache<void>): void;
  572. static STAGE_MEMORY: number;
  573. static STAGE_DEFAULT: number;
  574. static STAGE_DISK: number;
  575. static STAGE_NETWORK: number;
  576. }
  577. declare abstract class CacheFacade {
  578. getChildCache(name: string): CacheFacade;
  579. getItemCache(identifier: string, etag: null | Etag): ItemCacheFacade;
  580. getLazyHashedEtag(obj: HashableObject): Etag;
  581. mergeEtags(a: Etag, b: Etag): Etag;
  582. get<T>(
  583. identifier: string,
  584. etag: null | Etag,
  585. callback: CallbackCache<T>
  586. ): void;
  587. getPromise<T>(identifier: string, etag: null | Etag): Promise<T>;
  588. store<T>(
  589. identifier: string,
  590. etag: null | Etag,
  591. data: T,
  592. callback: CallbackCache<void>
  593. ): void;
  594. storePromise<T>(
  595. identifier: string,
  596. etag: null | Etag,
  597. data: T
  598. ): Promise<void>;
  599. provide<T>(
  600. identifier: string,
  601. etag: null | Etag,
  602. computer: (arg0: CallbackNormalErrorCache<T>) => void,
  603. callback: CallbackNormalErrorCache<T>
  604. ): void;
  605. providePromise<T>(
  606. identifier: string,
  607. etag: null | Etag,
  608. computer: () => T | Promise<T>
  609. ): Promise<T>;
  610. }
  611. declare interface CacheGroupSource {
  612. key?: string;
  613. priority?: number;
  614. getName?: (
  615. module?: Module,
  616. chunks?: Chunk[],
  617. key?: string
  618. ) => undefined | string;
  619. chunksFilter?: (chunk: Chunk) => boolean;
  620. enforce?: boolean;
  621. minSize: SplitChunksSizes;
  622. minSizeReduction: SplitChunksSizes;
  623. minRemainingSize: SplitChunksSizes;
  624. enforceSizeThreshold: SplitChunksSizes;
  625. maxAsyncSize: SplitChunksSizes;
  626. maxInitialSize: SplitChunksSizes;
  627. minChunks?: number;
  628. maxAsyncRequests?: number;
  629. maxInitialRequests?: number;
  630. filename?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
  631. idHint?: string;
  632. automaticNameDelimiter: string;
  633. reuseExistingChunk?: boolean;
  634. usedExports?: boolean;
  635. }
  636. declare interface CacheGroupsContext {
  637. moduleGraph: ModuleGraph;
  638. chunkGraph: ChunkGraph;
  639. }
  640. type CacheOptionsNormalized = false | FileCacheOptions | MemoryCacheOptions;
  641. declare class CachedSource extends Source {
  642. constructor(source: Source);
  643. constructor(source: Source | (() => Source), cachedData?: any);
  644. original(): Source;
  645. originalLazy(): Source | (() => Source);
  646. getCachedData(): any;
  647. }
  648. type CallExpression = SimpleCallExpression | NewExpression;
  649. declare interface CallExpressionInfo {
  650. type: "call";
  651. call: CallExpression;
  652. calleeName: string;
  653. rootInfo: string | VariableInfo;
  654. getCalleeMembers: () => string[];
  655. name: string;
  656. getMembers: () => string[];
  657. getMembersOptionals: () => boolean[];
  658. }
  659. declare interface CallbackAsyncQueue<T> {
  660. (err?: null | WebpackError, result?: T): any;
  661. }
  662. declare interface CallbackCache<T> {
  663. (err?: null | WebpackError, result?: T): void;
  664. }
  665. declare interface CallbackFunction<T> {
  666. (err?: null | Error, result?: T): any;
  667. }
  668. declare interface CallbackNormalErrorCache<T> {
  669. (err?: null | Error, result?: T): void;
  670. }
  671. declare interface CallbackWebpack<T> {
  672. (err?: Error, stats?: T): void;
  673. }
  674. type Cell<T> = undefined | T;
  675. declare class Chunk {
  676. constructor(name?: string, backCompat?: boolean);
  677. id: null | string | number;
  678. ids: null | (string | number)[];
  679. debugId: number;
  680. name: string;
  681. idNameHints: SortableSet<string>;
  682. preventIntegration: boolean;
  683. filenameTemplate:
  684. | null
  685. | string
  686. | ((arg0: PathData, arg1?: AssetInfo) => string);
  687. cssFilenameTemplate:
  688. | null
  689. | string
  690. | ((arg0: PathData, arg1?: AssetInfo) => string);
  691. runtime: RuntimeSpec;
  692. files: Set<string>;
  693. auxiliaryFiles: Set<string>;
  694. rendered: boolean;
  695. hash?: string;
  696. contentHash: Record<string, string>;
  697. renderedHash?: string;
  698. chunkReason?: string;
  699. extraAsync: boolean;
  700. readonly entryModule?: Module;
  701. hasEntryModule(): boolean;
  702. addModule(module: Module): boolean;
  703. removeModule(module: Module): void;
  704. getNumberOfModules(): number;
  705. readonly modulesIterable: Iterable<Module>;
  706. compareTo(otherChunk: Chunk): 0 | 1 | -1;
  707. containsModule(module: Module): boolean;
  708. getModules(): Module[];
  709. remove(): void;
  710. moveModule(module: Module, otherChunk: Chunk): void;
  711. integrate(otherChunk: Chunk): boolean;
  712. canBeIntegrated(otherChunk: Chunk): boolean;
  713. isEmpty(): boolean;
  714. modulesSize(): number;
  715. size(options?: ChunkSizeOptions): number;
  716. integratedSize(otherChunk: Chunk, options: ChunkSizeOptions): number;
  717. getChunkModuleMaps(filterFn: (m: Module) => boolean): ChunkModuleMaps;
  718. hasModuleInGraph(
  719. filterFn: (m: Module) => boolean,
  720. filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  721. ): boolean;
  722. getChunkMaps(realHash: boolean): ChunkMaps;
  723. hasRuntime(): boolean;
  724. canBeInitial(): boolean;
  725. isOnlyInitial(): boolean;
  726. getEntryOptions(): undefined | EntryOptions;
  727. addGroup(chunkGroup: ChunkGroup): void;
  728. removeGroup(chunkGroup: ChunkGroup): void;
  729. isInGroup(chunkGroup: ChunkGroup): boolean;
  730. getNumberOfGroups(): number;
  731. readonly groupsIterable: Iterable<ChunkGroup>;
  732. disconnectFromGroups(): void;
  733. split(newChunk: Chunk): void;
  734. updateHash(hash: Hash, chunkGraph: ChunkGraph): void;
  735. getAllAsyncChunks(): Set<Chunk>;
  736. getAllInitialChunks(): Set<Chunk>;
  737. getAllReferencedChunks(): Set<Chunk>;
  738. getAllReferencedAsyncEntrypoints(): Set<Entrypoint>;
  739. hasAsyncChunks(): boolean;
  740. getChildIdsByOrders(
  741. chunkGraph: ChunkGraph,
  742. filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  743. ): Record<string, (string | number)[]>;
  744. getChildrenOfTypeInOrder(
  745. chunkGraph: ChunkGraph,
  746. type: string
  747. ): { onChunks: Chunk[]; chunks: Set<Chunk> }[];
  748. getChildIdsByOrdersMap(
  749. chunkGraph: ChunkGraph,
  750. includeDirectChildren?: boolean,
  751. filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  752. ): Record<string | number, Record<string, (string | number)[]>>;
  753. }
  754. declare class ChunkGraph {
  755. constructor(moduleGraph: ModuleGraph, hashFunction?: string | typeof Hash);
  756. moduleGraph: ModuleGraph;
  757. connectChunkAndModule(chunk: Chunk, module: Module): void;
  758. disconnectChunkAndModule(chunk: Chunk, module: Module): void;
  759. disconnectChunk(chunk: Chunk): void;
  760. attachModules(chunk: Chunk, modules: Iterable<Module>): void;
  761. attachRuntimeModules(chunk: Chunk, modules: Iterable<RuntimeModule>): void;
  762. attachFullHashModules(chunk: Chunk, modules: Iterable<RuntimeModule>): void;
  763. attachDependentHashModules(
  764. chunk: Chunk,
  765. modules: Iterable<RuntimeModule>
  766. ): void;
  767. replaceModule(oldModule: Module, newModule: Module): void;
  768. isModuleInChunk(module: Module, chunk: Chunk): boolean;
  769. isModuleInChunkGroup(module: Module, chunkGroup: ChunkGroup): boolean;
  770. isEntryModule(module: Module): boolean;
  771. getModuleChunksIterable(module: Module): Iterable<Chunk>;
  772. getOrderedModuleChunksIterable(
  773. module: Module,
  774. sortFn: (arg0: Chunk, arg1: Chunk) => 0 | 1 | -1
  775. ): Iterable<Chunk>;
  776. getModuleChunks(module: Module): Chunk[];
  777. getNumberOfModuleChunks(module: Module): number;
  778. getModuleRuntimes(module: Module): RuntimeSpecSet;
  779. getNumberOfChunkModules(chunk: Chunk): number;
  780. getNumberOfChunkFullHashModules(chunk: Chunk): number;
  781. getChunkModulesIterable(chunk: Chunk): Iterable<Module>;
  782. getChunkModulesIterableBySourceType(
  783. chunk: Chunk,
  784. sourceType: string
  785. ): undefined | Iterable<Module>;
  786. setChunkModuleSourceTypes(
  787. chunk: Chunk,
  788. module: Module,
  789. sourceTypes: Set<string>
  790. ): void;
  791. getChunkModuleSourceTypes(chunk: Chunk, module: Module): Set<string>;
  792. getModuleSourceTypes(module: Module): Set<string>;
  793. getOrderedChunkModulesIterable(
  794. chunk: Chunk,
  795. comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
  796. ): Iterable<Module>;
  797. getOrderedChunkModulesIterableBySourceType(
  798. chunk: Chunk,
  799. sourceType: string,
  800. comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
  801. ): undefined | Iterable<Module>;
  802. getChunkModules(chunk: Chunk): Module[];
  803. getOrderedChunkModules(
  804. chunk: Chunk,
  805. comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
  806. ): Module[];
  807. getChunkModuleIdMap(
  808. chunk: Chunk,
  809. filterFn: (m: Module) => boolean,
  810. includeAllChunks?: boolean
  811. ): Record<string | number, (string | number)[]>;
  812. getChunkModuleRenderedHashMap(
  813. chunk: Chunk,
  814. filterFn: (m: Module) => boolean,
  815. hashLength?: number,
  816. includeAllChunks?: boolean
  817. ): Record<string | number, Record<string | number, string>>;
  818. getChunkConditionMap(
  819. chunk: Chunk,
  820. filterFn: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  821. ): Record<string | number, boolean>;
  822. hasModuleInGraph(
  823. chunk: Chunk,
  824. filterFn: (m: Module) => boolean,
  825. filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  826. ): boolean;
  827. compareChunks(chunkA: Chunk, chunkB: Chunk): 0 | 1 | -1;
  828. getChunkModulesSize(chunk: Chunk): number;
  829. getChunkModulesSizes(chunk: Chunk): Record<string, number>;
  830. getChunkRootModules(chunk: Chunk): Module[];
  831. getChunkSize(chunk: Chunk, options?: ChunkSizeOptions): number;
  832. getIntegratedChunksSize(
  833. chunkA: Chunk,
  834. chunkB: Chunk,
  835. options?: ChunkSizeOptions
  836. ): number;
  837. canChunksBeIntegrated(chunkA: Chunk, chunkB: Chunk): boolean;
  838. integrateChunks(chunkA: Chunk, chunkB: Chunk): void;
  839. upgradeDependentToFullHashModules(chunk: Chunk): void;
  840. isEntryModuleInChunk(module: Module, chunk: Chunk): boolean;
  841. connectChunkAndEntryModule(
  842. chunk: Chunk,
  843. module: Module,
  844. entrypoint?: Entrypoint
  845. ): void;
  846. connectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
  847. addFullHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
  848. addDependentHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
  849. disconnectChunkAndEntryModule(chunk: Chunk, module: Module): void;
  850. disconnectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
  851. disconnectEntryModule(module: Module): void;
  852. disconnectEntries(chunk: Chunk): void;
  853. getNumberOfEntryModules(chunk: Chunk): number;
  854. getNumberOfRuntimeModules(chunk: Chunk): number;
  855. getChunkEntryModulesIterable(chunk: Chunk): Iterable<Module>;
  856. getChunkEntryDependentChunksIterable(chunk: Chunk): Iterable<Chunk>;
  857. hasChunkEntryDependentChunks(chunk: Chunk): boolean;
  858. getChunkRuntimeModulesIterable(chunk: Chunk): Iterable<RuntimeModule>;
  859. getChunkRuntimeModulesInOrder(chunk: Chunk): RuntimeModule[];
  860. getChunkFullHashModulesIterable(
  861. chunk: Chunk
  862. ): undefined | Iterable<RuntimeModule>;
  863. getChunkFullHashModulesSet(
  864. chunk: Chunk
  865. ): undefined | ReadonlySet<RuntimeModule>;
  866. getChunkDependentHashModulesIterable(
  867. chunk: Chunk
  868. ): undefined | Iterable<RuntimeModule>;
  869. getChunkEntryModulesWithChunkGroupIterable(
  870. chunk: Chunk
  871. ): Iterable<[Module, undefined | Entrypoint]>;
  872. getBlockChunkGroup(depBlock: AsyncDependenciesBlock): ChunkGroup;
  873. connectBlockAndChunkGroup(
  874. depBlock: AsyncDependenciesBlock,
  875. chunkGroup: ChunkGroup
  876. ): void;
  877. disconnectChunkGroup(chunkGroup: ChunkGroup): void;
  878. getModuleId(module: Module): string | number;
  879. setModuleId(module: Module, id: string | number): void;
  880. getRuntimeId(runtime: string): string | number;
  881. setRuntimeId(runtime: string, id: string | number): void;
  882. hasModuleHashes(module: Module, runtime: RuntimeSpec): boolean;
  883. getModuleHash(module: Module, runtime: RuntimeSpec): string;
  884. getRenderedModuleHash(module: Module, runtime: RuntimeSpec): string;
  885. setModuleHashes(
  886. module: Module,
  887. runtime: RuntimeSpec,
  888. hash: string,
  889. renderedHash: string
  890. ): void;
  891. addModuleRuntimeRequirements(
  892. module: Module,
  893. runtime: RuntimeSpec,
  894. items: Set<string>,
  895. transferOwnership?: boolean
  896. ): void;
  897. addChunkRuntimeRequirements(chunk: Chunk, items: Set<string>): void;
  898. addTreeRuntimeRequirements(chunk: Chunk, items: Iterable<string>): void;
  899. getModuleRuntimeRequirements(
  900. module: Module,
  901. runtime: RuntimeSpec
  902. ): ReadonlySet<string>;
  903. getChunkRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
  904. getModuleGraphHash(
  905. module: Module,
  906. runtime: RuntimeSpec,
  907. withConnections?: boolean
  908. ): string;
  909. getModuleGraphHashBigInt(
  910. module: Module,
  911. runtime: RuntimeSpec,
  912. withConnections?: boolean
  913. ): bigint;
  914. getTreeRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
  915. static getChunkGraphForModule(
  916. module: Module,
  917. deprecateMessage: string,
  918. deprecationCode: string
  919. ): ChunkGraph;
  920. static setChunkGraphForModule(module: Module, chunkGraph: ChunkGraph): void;
  921. static clearChunkGraphForModule(module: Module): void;
  922. static getChunkGraphForChunk(
  923. chunk: Chunk,
  924. deprecateMessage: string,
  925. deprecationCode: string
  926. ): ChunkGraph;
  927. static setChunkGraphForChunk(chunk: Chunk, chunkGraph: ChunkGraph): void;
  928. static clearChunkGraphForChunk(chunk: Chunk): void;
  929. }
  930. declare abstract class ChunkGroup {
  931. groupDebugId: number;
  932. options: ChunkGroupOptions;
  933. chunks: Chunk[];
  934. origins: OriginRecord[];
  935. index: number;
  936. /**
  937. * when a new chunk is added to a chunkGroup, addingOptions will occur.
  938. */
  939. addOptions(options: ChunkGroupOptions): void;
  940. /**
  941. * returns the name of current ChunkGroup
  942. * sets a new name for current ChunkGroup
  943. */
  944. name?: string;
  945. /**
  946. * get a uniqueId for ChunkGroup, made up of its member Chunk debugId's
  947. */
  948. readonly debugId: string;
  949. /**
  950. * get a unique id for ChunkGroup, made up of its member Chunk id's
  951. */
  952. readonly id: string;
  953. /**
  954. * Performs an unshift of a specific chunk
  955. */
  956. unshiftChunk(chunk: Chunk): boolean;
  957. /**
  958. * inserts a chunk before another existing chunk in group
  959. */
  960. insertChunk(chunk: Chunk, before: Chunk): boolean;
  961. /**
  962. * add a chunk into ChunkGroup. Is pushed on or prepended
  963. */
  964. pushChunk(chunk: Chunk): boolean;
  965. replaceChunk(oldChunk: Chunk, newChunk: Chunk): boolean;
  966. removeChunk(chunk: Chunk): boolean;
  967. isInitial(): boolean;
  968. addChild(group: ChunkGroup): boolean;
  969. getChildren(): ChunkGroup[];
  970. getNumberOfChildren(): number;
  971. readonly childrenIterable: SortableSet<ChunkGroup>;
  972. removeChild(group: ChunkGroup): boolean;
  973. addParent(parentChunk: ChunkGroup): boolean;
  974. getParents(): ChunkGroup[];
  975. getNumberOfParents(): number;
  976. hasParent(parent: ChunkGroup): boolean;
  977. readonly parentsIterable: SortableSet<ChunkGroup>;
  978. removeParent(chunkGroup: ChunkGroup): boolean;
  979. addAsyncEntrypoint(entrypoint: Entrypoint): boolean;
  980. readonly asyncEntrypointsIterable: SortableSet<ChunkGroup>;
  981. getBlocks(): any[];
  982. getNumberOfBlocks(): number;
  983. hasBlock(block?: any): boolean;
  984. readonly blocksIterable: Iterable<AsyncDependenciesBlock>;
  985. addBlock(block: AsyncDependenciesBlock): boolean;
  986. addOrigin(module: Module, loc: DependencyLocation, request: string): void;
  987. getFiles(): string[];
  988. remove(): void;
  989. sortItems(): void;
  990. /**
  991. * Sorting predicate which allows current ChunkGroup to be compared against another.
  992. * Sorting values are based off of number of chunks in ChunkGroup.
  993. */
  994. compareTo(chunkGraph: ChunkGraph, otherGroup: ChunkGroup): 0 | 1 | -1;
  995. getChildrenByOrders(
  996. moduleGraph: ModuleGraph,
  997. chunkGraph: ChunkGraph
  998. ): Record<string, ChunkGroup[]>;
  999. /**
  1000. * Sets the top-down index of a module in this ChunkGroup
  1001. */
  1002. setModulePreOrderIndex(module: Module, index: number): void;
  1003. /**
  1004. * Gets the top-down index of a module in this ChunkGroup
  1005. */
  1006. getModulePreOrderIndex(module: Module): number;
  1007. /**
  1008. * Sets the bottom-up index of a module in this ChunkGroup
  1009. */
  1010. setModulePostOrderIndex(module: Module, index: number): void;
  1011. /**
  1012. * Gets the bottom-up index of a module in this ChunkGroup
  1013. */
  1014. getModulePostOrderIndex(module: Module): number;
  1015. checkConstraints(): void;
  1016. getModuleIndex: (module: Module) => number;
  1017. getModuleIndex2: (module: Module) => number;
  1018. }
  1019. type ChunkGroupOptions = RawChunkGroupOptions & { name?: string };
  1020. declare interface ChunkHashContext {
  1021. /**
  1022. * results of code generation
  1023. */
  1024. codeGenerationResults: CodeGenerationResults;
  1025. /**
  1026. * the runtime template
  1027. */
  1028. runtimeTemplate: RuntimeTemplate;
  1029. /**
  1030. * the module graph
  1031. */
  1032. moduleGraph: ModuleGraph;
  1033. /**
  1034. * the chunk graph
  1035. */
  1036. chunkGraph: ChunkGraph;
  1037. }
  1038. declare interface ChunkMaps {
  1039. hash: Record<string | number, string>;
  1040. contentHash: Record<string | number, Record<string, string>>;
  1041. name: Record<string | number, string>;
  1042. }
  1043. declare class ChunkModuleIdRangePlugin {
  1044. constructor(options?: any);
  1045. options: any;
  1046. /**
  1047. * Apply the plugin
  1048. */
  1049. apply(compiler: Compiler): void;
  1050. }
  1051. declare interface ChunkModuleMaps {
  1052. id: Record<string | number, (string | number)[]>;
  1053. hash: Record<string | number, string>;
  1054. }
  1055. declare interface ChunkPathData {
  1056. id: string | number;
  1057. name?: string;
  1058. hash: string;
  1059. hashWithLength?: (arg0: number) => string;
  1060. contentHash?: Record<string, string>;
  1061. contentHashWithLength?: Record<string, (length: number) => string>;
  1062. }
  1063. declare class ChunkPrefetchPreloadPlugin {
  1064. constructor();
  1065. apply(compiler: Compiler): void;
  1066. }
  1067. declare interface ChunkRenderContext {
  1068. /**
  1069. * the chunk
  1070. */
  1071. chunk: Chunk;
  1072. /**
  1073. * the dependency templates
  1074. */
  1075. dependencyTemplates: DependencyTemplates;
  1076. /**
  1077. * the runtime template
  1078. */
  1079. runtimeTemplate: RuntimeTemplate;
  1080. /**
  1081. * the module graph
  1082. */
  1083. moduleGraph: ModuleGraph;
  1084. /**
  1085. * the chunk graph
  1086. */
  1087. chunkGraph: ChunkGraph;
  1088. /**
  1089. * results of code generation
  1090. */
  1091. codeGenerationResults: CodeGenerationResults;
  1092. /**
  1093. * init fragments for the chunk
  1094. */
  1095. chunkInitFragments: InitFragment<ChunkRenderContext>[];
  1096. /**
  1097. * rendering in strict context
  1098. */
  1099. strictMode: boolean;
  1100. }
  1101. declare interface ChunkSizeOptions {
  1102. /**
  1103. * constant overhead for a chunk
  1104. */
  1105. chunkOverhead?: number;
  1106. /**
  1107. * multiplicator for initial chunks
  1108. */
  1109. entryChunkMultiplicator?: number;
  1110. }
  1111. declare abstract class ChunkTemplate {
  1112. hooks: Readonly<{
  1113. renderManifest: { tap: (options?: any, fn?: any) => void };
  1114. modules: { tap: (options?: any, fn?: any) => void };
  1115. render: { tap: (options?: any, fn?: any) => void };
  1116. renderWithEntry: { tap: (options?: any, fn?: any) => void };
  1117. hash: { tap: (options?: any, fn?: any) => void };
  1118. hashForChunk: { tap: (options?: any, fn?: any) => void };
  1119. }>;
  1120. readonly outputOptions: Output;
  1121. }
  1122. /**
  1123. * Advanced options for cleaning assets.
  1124. */
  1125. declare interface CleanOptions {
  1126. /**
  1127. * Log the assets that should be removed instead of deleting them.
  1128. */
  1129. dry?: boolean;
  1130. /**
  1131. * Keep these assets.
  1132. */
  1133. keep?: string | RegExp | ((filename: string) => boolean);
  1134. }
  1135. declare class CleanPlugin {
  1136. constructor(options?: CleanOptions);
  1137. options: {
  1138. /**
  1139. * Log the assets that should be removed instead of deleting them.
  1140. */
  1141. dry: boolean;
  1142. /**
  1143. * Keep these assets.
  1144. */
  1145. keep?: string | RegExp | ((filename: string) => boolean);
  1146. };
  1147. /**
  1148. * Apply the plugin
  1149. */
  1150. apply(compiler: Compiler): void;
  1151. static getCompilationHooks(
  1152. compilation: Compilation
  1153. ): CleanPluginCompilationHooks;
  1154. }
  1155. declare interface CleanPluginCompilationHooks {
  1156. /**
  1157. * when returning true the file/directory will be kept during cleaning, returning false will clean it and ignore the following plugins and config
  1158. */
  1159. keep: SyncBailHook<[string], boolean>;
  1160. }
  1161. declare interface CodeGenerationContext {
  1162. /**
  1163. * the dependency templates
  1164. */
  1165. dependencyTemplates: DependencyTemplates;
  1166. /**
  1167. * the runtime template
  1168. */
  1169. runtimeTemplate: RuntimeTemplate;
  1170. /**
  1171. * the module graph
  1172. */
  1173. moduleGraph: ModuleGraph;
  1174. /**
  1175. * the chunk graph
  1176. */
  1177. chunkGraph: ChunkGraph;
  1178. /**
  1179. * the runtimes code should be generated for
  1180. */
  1181. runtime: RuntimeSpec;
  1182. /**
  1183. * when in concatenated module, information about other concatenated modules
  1184. */
  1185. concatenationScope?: ConcatenationScope;
  1186. /**
  1187. * code generation results of other modules (need to have a codeGenerationDependency to use that)
  1188. */
  1189. codeGenerationResults: CodeGenerationResults;
  1190. /**
  1191. * the compilation
  1192. */
  1193. compilation?: Compilation;
  1194. /**
  1195. * source types
  1196. */
  1197. sourceTypes?: ReadonlySet<string>;
  1198. }
  1199. declare interface CodeGenerationResult {
  1200. /**
  1201. * the resulting sources for all source types
  1202. */
  1203. sources: Map<string, Source>;
  1204. /**
  1205. * the resulting data for all source types
  1206. */
  1207. data?: Map<string, any>;
  1208. /**
  1209. * the runtime requirements
  1210. */
  1211. runtimeRequirements: ReadonlySet<string>;
  1212. /**
  1213. * a hash of the code generation result (will be automatically calculated from sources and runtimeRequirements if not provided)
  1214. */
  1215. hash?: string;
  1216. }
  1217. declare abstract class CodeGenerationResults {
  1218. map: Map<Module, RuntimeSpecMap<CodeGenerationResult>>;
  1219. get(module: Module, runtime: RuntimeSpec): CodeGenerationResult;
  1220. has(module: Module, runtime: RuntimeSpec): boolean;
  1221. getSource(module: Module, runtime: RuntimeSpec, sourceType: string): Source;
  1222. getRuntimeRequirements(
  1223. module: Module,
  1224. runtime: RuntimeSpec
  1225. ): ReadonlySet<string>;
  1226. getData(module: Module, runtime: RuntimeSpec, key: string): any;
  1227. getHash(module: Module, runtime: RuntimeSpec): any;
  1228. add(module: Module, runtime: RuntimeSpec, result: CodeGenerationResult): void;
  1229. }
  1230. type CodeValue =
  1231. | undefined
  1232. | null
  1233. | string
  1234. | number
  1235. | bigint
  1236. | boolean
  1237. | Function
  1238. | RegExp
  1239. | RuntimeValue
  1240. | {
  1241. [index: string]: RecursiveArrayOrRecord<
  1242. | undefined
  1243. | null
  1244. | string
  1245. | number
  1246. | bigint
  1247. | boolean
  1248. | Function
  1249. | RegExp
  1250. | RuntimeValue
  1251. >;
  1252. }
  1253. | RecursiveArrayOrRecord<
  1254. | undefined
  1255. | null
  1256. | string
  1257. | number
  1258. | bigint
  1259. | boolean
  1260. | Function
  1261. | RegExp
  1262. | RuntimeValue
  1263. >[];
  1264. type CodeValuePrimitive =
  1265. | undefined
  1266. | null
  1267. | string
  1268. | number
  1269. | bigint
  1270. | boolean
  1271. | Function
  1272. | RegExp;
  1273. declare interface Comparator<T> {
  1274. (arg0: T, arg1: T): 0 | 1 | -1;
  1275. }
  1276. declare class CompatSource extends Source {
  1277. constructor(sourceLike: SourceLike);
  1278. static from(sourceLike: SourceLike): Source;
  1279. }
  1280. declare class Compilation {
  1281. /**
  1282. * Creates an instance of Compilation.
  1283. */
  1284. constructor(compiler: Compiler, params: CompilationParams);
  1285. hooks: Readonly<{
  1286. buildModule: SyncHook<[Module]>;
  1287. rebuildModule: SyncHook<[Module]>;
  1288. failedModule: SyncHook<[Module, WebpackError]>;
  1289. succeedModule: SyncHook<[Module]>;
  1290. stillValidModule: SyncHook<[Module]>;
  1291. addEntry: SyncHook<[Dependency, EntryOptions]>;
  1292. failedEntry: SyncHook<[Dependency, EntryOptions, Error]>;
  1293. succeedEntry: SyncHook<[Dependency, EntryOptions, Module]>;
  1294. dependencyReferencedExports: SyncWaterfallHook<
  1295. [(string[] | ReferencedExport)[], Dependency, RuntimeSpec]
  1296. >;
  1297. executeModule: SyncHook<[ExecuteModuleArgument, ExecuteModuleContext]>;
  1298. prepareModuleExecution: AsyncParallelHook<
  1299. [ExecuteModuleArgument, ExecuteModuleContext]
  1300. >;
  1301. finishModules: AsyncSeriesHook<[Iterable<Module>]>;
  1302. finishRebuildingModule: AsyncSeriesHook<[Module]>;
  1303. unseal: SyncHook<[]>;
  1304. seal: SyncHook<[]>;
  1305. beforeChunks: SyncHook<[]>;
  1306. afterChunks: SyncHook<[Iterable<Chunk>]>;
  1307. optimizeDependencies: SyncBailHook<[Iterable<Module>], any>;
  1308. afterOptimizeDependencies: SyncHook<[Iterable<Module>]>;
  1309. optimize: SyncHook<[]>;
  1310. optimizeModules: SyncBailHook<[Iterable<Module>], any>;
  1311. afterOptimizeModules: SyncHook<[Iterable<Module>]>;
  1312. optimizeChunks: SyncBailHook<[Iterable<Chunk>, ChunkGroup[]], any>;
  1313. afterOptimizeChunks: SyncHook<[Iterable<Chunk>, ChunkGroup[]]>;
  1314. optimizeTree: AsyncSeriesHook<[Iterable<Chunk>, Iterable<Module>]>;
  1315. afterOptimizeTree: SyncHook<[Iterable<Chunk>, Iterable<Module>]>;
  1316. optimizeChunkModules: AsyncSeriesBailHook<
  1317. [Iterable<Chunk>, Iterable<Module>],
  1318. any
  1319. >;
  1320. afterOptimizeChunkModules: SyncHook<[Iterable<Chunk>, Iterable<Module>]>;
  1321. shouldRecord: SyncBailHook<[], boolean>;
  1322. additionalChunkRuntimeRequirements: SyncHook<
  1323. [Chunk, Set<string>, RuntimeRequirementsContext]
  1324. >;
  1325. runtimeRequirementInChunk: HookMap<
  1326. SyncBailHook<[Chunk, Set<string>, RuntimeRequirementsContext], any>
  1327. >;
  1328. additionalModuleRuntimeRequirements: SyncHook<
  1329. [Module, Set<string>, RuntimeRequirementsContext]
  1330. >;
  1331. runtimeRequirementInModule: HookMap<
  1332. SyncBailHook<[Module, Set<string>, RuntimeRequirementsContext], any>
  1333. >;
  1334. additionalTreeRuntimeRequirements: SyncHook<
  1335. [Chunk, Set<string>, RuntimeRequirementsContext]
  1336. >;
  1337. runtimeRequirementInTree: HookMap<
  1338. SyncBailHook<[Chunk, Set<string>, RuntimeRequirementsContext], any>
  1339. >;
  1340. runtimeModule: SyncHook<[RuntimeModule, Chunk]>;
  1341. reviveModules: SyncHook<[Iterable<Module>, any]>;
  1342. beforeModuleIds: SyncHook<[Iterable<Module>]>;
  1343. moduleIds: SyncHook<[Iterable<Module>]>;
  1344. optimizeModuleIds: SyncHook<[Iterable<Module>]>;
  1345. afterOptimizeModuleIds: SyncHook<[Iterable<Module>]>;
  1346. reviveChunks: SyncHook<[Iterable<Chunk>, any]>;
  1347. beforeChunkIds: SyncHook<[Iterable<Chunk>]>;
  1348. chunkIds: SyncHook<[Iterable<Chunk>]>;
  1349. optimizeChunkIds: SyncHook<[Iterable<Chunk>]>;
  1350. afterOptimizeChunkIds: SyncHook<[Iterable<Chunk>]>;
  1351. recordModules: SyncHook<[Iterable<Module>, any]>;
  1352. recordChunks: SyncHook<[Iterable<Chunk>, any]>;
  1353. optimizeCodeGeneration: SyncHook<[Iterable<Module>]>;
  1354. beforeModuleHash: SyncHook<[]>;
  1355. afterModuleHash: SyncHook<[]>;
  1356. beforeCodeGeneration: SyncHook<[]>;
  1357. afterCodeGeneration: SyncHook<[]>;
  1358. beforeRuntimeRequirements: SyncHook<[]>;
  1359. afterRuntimeRequirements: SyncHook<[]>;
  1360. beforeHash: SyncHook<[]>;
  1361. contentHash: SyncHook<[Chunk]>;
  1362. afterHash: SyncHook<[]>;
  1363. recordHash: SyncHook<[any]>;
  1364. record: SyncHook<[Compilation, any]>;
  1365. beforeModuleAssets: SyncHook<[]>;
  1366. shouldGenerateChunkAssets: SyncBailHook<[], boolean>;
  1367. beforeChunkAssets: SyncHook<[]>;
  1368. additionalChunkAssets: FakeHook<
  1369. Pick<
  1370. AsyncSeriesHook<[Set<Chunk>]>,
  1371. "name" | "tap" | "tapAsync" | "tapPromise"
  1372. >
  1373. >;
  1374. additionalAssets: FakeHook<
  1375. Pick<AsyncSeriesHook<[]>, "name" | "tap" | "tapAsync" | "tapPromise">
  1376. >;
  1377. optimizeChunkAssets: FakeHook<
  1378. Pick<
  1379. AsyncSeriesHook<[Set<Chunk>]>,
  1380. "name" | "tap" | "tapAsync" | "tapPromise"
  1381. >
  1382. >;
  1383. afterOptimizeChunkAssets: FakeHook<
  1384. Pick<
  1385. AsyncSeriesHook<[Set<Chunk>]>,
  1386. "name" | "tap" | "tapAsync" | "tapPromise"
  1387. >
  1388. >;
  1389. optimizeAssets: AsyncSeriesHook<
  1390. [CompilationAssets],
  1391. ProcessAssetsAdditionalOptions
  1392. >;
  1393. afterOptimizeAssets: SyncHook<[CompilationAssets]>;
  1394. processAssets: AsyncSeriesHook<
  1395. [CompilationAssets],
  1396. ProcessAssetsAdditionalOptions
  1397. >;
  1398. afterProcessAssets: SyncHook<[CompilationAssets]>;
  1399. processAdditionalAssets: AsyncSeriesHook<[CompilationAssets]>;
  1400. needAdditionalSeal: SyncBailHook<[], boolean>;
  1401. afterSeal: AsyncSeriesHook<[]>;
  1402. renderManifest: SyncWaterfallHook<
  1403. [RenderManifestEntry[], RenderManifestOptions]
  1404. >;
  1405. fullHash: SyncHook<[Hash]>;
  1406. chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
  1407. moduleAsset: SyncHook<[Module, string]>;
  1408. chunkAsset: SyncHook<[Chunk, string]>;
  1409. assetPath: SyncWaterfallHook<[string, object, AssetInfo]>;
  1410. needAdditionalPass: SyncBailHook<[], boolean>;
  1411. childCompiler: SyncHook<[Compiler, string, number]>;
  1412. log: SyncBailHook<[string, LogEntry], true>;
  1413. processWarnings: SyncWaterfallHook<[WebpackError[]]>;
  1414. processErrors: SyncWaterfallHook<[WebpackError[]]>;
  1415. statsPreset: HookMap<
  1416. SyncHook<[Partial<NormalizedStatsOptions>, CreateStatsOptionsContext]>
  1417. >;
  1418. statsNormalize: SyncHook<
  1419. [Partial<NormalizedStatsOptions>, CreateStatsOptionsContext]
  1420. >;
  1421. statsFactory: SyncHook<[StatsFactory, NormalizedStatsOptions]>;
  1422. statsPrinter: SyncHook<[StatsPrinter, NormalizedStatsOptions]>;
  1423. readonly normalModuleLoader: SyncHook<[object, NormalModule]>;
  1424. }>;
  1425. name?: string;
  1426. startTime: any;
  1427. endTime: any;
  1428. compiler: Compiler;
  1429. resolverFactory: ResolverFactory;
  1430. inputFileSystem: InputFileSystem;
  1431. fileSystemInfo: FileSystemInfo;
  1432. valueCacheVersions: Map<string, string | Set<string>>;
  1433. requestShortener: RequestShortener;
  1434. compilerPath: string;
  1435. logger: WebpackLogger;
  1436. options: WebpackOptionsNormalized;
  1437. outputOptions: OutputNormalized;
  1438. bail: boolean;
  1439. profile: boolean;
  1440. params: CompilationParams;
  1441. mainTemplate: MainTemplate;
  1442. chunkTemplate: ChunkTemplate;
  1443. runtimeTemplate: RuntimeTemplate;
  1444. moduleTemplates: { javascript: ModuleTemplate };
  1445. moduleMemCaches?: Map<Module, WeakTupleMap<any, any>>;
  1446. moduleMemCaches2?: Map<Module, WeakTupleMap<any, any>>;
  1447. moduleGraph: ModuleGraph;
  1448. chunkGraph: ChunkGraph;
  1449. codeGenerationResults: CodeGenerationResults;
  1450. processDependenciesQueue: AsyncQueue<Module, Module, Module>;
  1451. addModuleQueue: AsyncQueue<Module, string, Module>;
  1452. factorizeQueue: AsyncQueue<
  1453. FactorizeModuleOptions,
  1454. string,
  1455. Module | ModuleFactoryResult
  1456. >;
  1457. buildQueue: AsyncQueue<Module, Module, Module>;
  1458. rebuildQueue: AsyncQueue<Module, Module, Module>;
  1459. /**
  1460. * Modules in value are building during the build of Module in key.
  1461. * Means value blocking key from finishing.
  1462. * Needed to detect build cycles.
  1463. */
  1464. creatingModuleDuringBuild: WeakMap<Module, Set<Module>>;
  1465. entries: Map<string, EntryData>;
  1466. globalEntry: EntryData;
  1467. entrypoints: Map<string, Entrypoint>;
  1468. asyncEntrypoints: Entrypoint[];
  1469. chunks: Set<Chunk>;
  1470. chunkGroups: ChunkGroup[];
  1471. namedChunkGroups: Map<string, ChunkGroup>;
  1472. namedChunks: Map<string, Chunk>;
  1473. modules: Set<Module>;
  1474. records: any;
  1475. additionalChunkAssets: string[];
  1476. assets: CompilationAssets;
  1477. assetsInfo: Map<string, AssetInfo>;
  1478. errors: WebpackError[];
  1479. warnings: WebpackError[];
  1480. children: Compilation[];
  1481. logging: Map<string, LogEntry[]>;
  1482. dependencyFactories: Map<DepConstructor, ModuleFactory>;
  1483. dependencyTemplates: DependencyTemplates;
  1484. childrenCounters: object;
  1485. usedChunkIds: Set<string | number>;
  1486. usedModuleIds: Set<number>;
  1487. needAdditionalPass: boolean;
  1488. builtModules: WeakSet<Module>;
  1489. codeGeneratedModules: WeakSet<Module>;
  1490. buildTimeExecutedModules: WeakSet<Module>;
  1491. emittedAssets: Set<string>;
  1492. comparedForEmitAssets: Set<string>;
  1493. fileDependencies: LazySet<string>;
  1494. contextDependencies: LazySet<string>;
  1495. missingDependencies: LazySet<string>;
  1496. buildDependencies: LazySet<string>;
  1497. compilationDependencies: { add: (item?: any) => LazySet<string> };
  1498. getStats(): Stats;
  1499. createStatsOptions(
  1500. optionsOrPreset: string | StatsOptions,
  1501. context?: CreateStatsOptionsContext
  1502. ): NormalizedStatsOptions;
  1503. createStatsFactory(options?: any): StatsFactory;
  1504. createStatsPrinter(options?: any): StatsPrinter;
  1505. getCache(name: string): CacheFacade;
  1506. getLogger(name: string | (() => string)): WebpackLogger;
  1507. addModule(
  1508. module: Module,
  1509. callback: (err?: null | WebpackError, result?: Module) => void
  1510. ): void;
  1511. /**
  1512. * Fetches a module from a compilation by its identifier
  1513. */
  1514. getModule(module: Module): Module;
  1515. /**
  1516. * Attempts to search for a module by its identifier
  1517. */
  1518. findModule(identifier: string): undefined | Module;
  1519. /**
  1520. * Schedules a build of the module object
  1521. */
  1522. buildModule(
  1523. module: Module,
  1524. callback: (err?: null | WebpackError, result?: Module) => void
  1525. ): void;
  1526. processModuleDependencies(
  1527. module: Module,
  1528. callback: (err?: null | WebpackError, result?: Module) => void
  1529. ): void;
  1530. processModuleDependenciesNonRecursive(module: Module): void;
  1531. handleModuleCreation(
  1532. __0: HandleModuleCreationOptions,
  1533. callback: (err?: null | WebpackError, result?: Module) => void
  1534. ): void;
  1535. addModuleChain(
  1536. context: string,
  1537. dependency: Dependency,
  1538. callback: (err?: null | WebpackError, result?: Module) => void
  1539. ): void;
  1540. addModuleTree(
  1541. __0: {
  1542. /**
  1543. * context string path
  1544. */
  1545. context: string;
  1546. /**
  1547. * dependency used to create Module chain
  1548. */
  1549. dependency: Dependency;
  1550. /**
  1551. * additional context info for the root module
  1552. */
  1553. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  1554. },
  1555. callback: (err?: null | WebpackError, result?: Module) => void
  1556. ): void;
  1557. addEntry(
  1558. context: string,
  1559. entry: Dependency,
  1560. optionsOrName: string | EntryOptions,
  1561. callback: (err?: null | WebpackError, result?: Module) => void
  1562. ): void;
  1563. addInclude(
  1564. context: string,
  1565. dependency: Dependency,
  1566. options: EntryOptions,
  1567. callback: (err?: null | WebpackError, result?: Module) => void
  1568. ): void;
  1569. rebuildModule(
  1570. module: Module,
  1571. callback: (err?: null | WebpackError, result?: Module) => void
  1572. ): void;
  1573. finish(callback?: any): void;
  1574. unseal(): void;
  1575. seal(callback: (err?: null | WebpackError) => void): void;
  1576. reportDependencyErrorsAndWarnings(
  1577. module: Module,
  1578. blocks: DependenciesBlock[]
  1579. ): boolean;
  1580. codeGeneration(callback?: any): void;
  1581. processRuntimeRequirements(__0?: {
  1582. /**
  1583. * the chunk graph
  1584. */
  1585. chunkGraph?: ChunkGraph;
  1586. /**
  1587. * modules
  1588. */
  1589. modules?: Iterable<Module>;
  1590. /**
  1591. * chunks
  1592. */
  1593. chunks?: Iterable<Chunk>;
  1594. /**
  1595. * codeGenerationResults
  1596. */
  1597. codeGenerationResults?: CodeGenerationResults;
  1598. /**
  1599. * chunkGraphEntries
  1600. */
  1601. chunkGraphEntries?: Iterable<Chunk>;
  1602. }): void;
  1603. addRuntimeModule(
  1604. chunk: Chunk,
  1605. module: RuntimeModule,
  1606. chunkGraph?: ChunkGraph
  1607. ): void;
  1608. /**
  1609. * If `module` is passed, `loc` and `request` must also be passed.
  1610. */
  1611. addChunkInGroup(
  1612. groupOptions: string | ChunkGroupOptions,
  1613. module?: Module,
  1614. loc?: SyntheticDependencyLocation | RealDependencyLocation,
  1615. request?: string
  1616. ): ChunkGroup;
  1617. addAsyncEntrypoint(
  1618. options: EntryOptions,
  1619. module: Module,
  1620. loc: DependencyLocation,
  1621. request: string
  1622. ): Entrypoint;
  1623. /**
  1624. * This method first looks to see if a name is provided for a new chunk,
  1625. * and first looks to see if any named chunks already exist and reuse that chunk instead.
  1626. */
  1627. addChunk(name?: string): Chunk;
  1628. assignDepth(module: Module): void;
  1629. assignDepths(modules: Set<Module>): void;
  1630. getDependencyReferencedExports(
  1631. dependency: Dependency,
  1632. runtime: RuntimeSpec
  1633. ): (string[] | ReferencedExport)[];
  1634. removeReasonsOfDependencyBlock(
  1635. module: Module,
  1636. block: DependenciesBlockLike
  1637. ): void;
  1638. patchChunksAfterReasonRemoval(module: Module, chunk: Chunk): void;
  1639. removeChunkFromDependencies(block: DependenciesBlock, chunk: Chunk): void;
  1640. assignRuntimeIds(): void;
  1641. sortItemsWithChunkIds(): void;
  1642. summarizeDependencies(): void;
  1643. createModuleHashes(): void;
  1644. createHash(): {
  1645. module: Module;
  1646. hash: string;
  1647. runtime: RuntimeSpec;
  1648. runtimes: RuntimeSpec[];
  1649. }[];
  1650. fullHash?: string;
  1651. hash?: string;
  1652. emitAsset(file: string, source: Source, assetInfo?: AssetInfo): void;
  1653. updateAsset(
  1654. file: string,
  1655. newSourceOrFunction: Source | ((arg0: Source) => Source),
  1656. assetInfoUpdateOrFunction?: AssetInfo | ((arg0?: AssetInfo) => AssetInfo)
  1657. ): void;
  1658. renameAsset(file?: any, newFile?: any): void;
  1659. deleteAsset(file: string): void;
  1660. getAssets(): Readonly<Asset>[];
  1661. getAsset(name: string): undefined | Readonly<Asset>;
  1662. clearAssets(): void;
  1663. createModuleAssets(): void;
  1664. getRenderManifest(options: RenderManifestOptions): RenderManifestEntry[];
  1665. createChunkAssets(callback: (err?: null | WebpackError) => void): void;
  1666. getPath(
  1667. filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
  1668. data?: PathData
  1669. ): string;
  1670. getPathWithInfo(
  1671. filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
  1672. data?: PathData
  1673. ): { path: string; info: AssetInfo };
  1674. getAssetPath(
  1675. filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
  1676. data: PathData
  1677. ): string;
  1678. getAssetPathWithInfo(
  1679. filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
  1680. data: PathData
  1681. ): { path: string; info: AssetInfo };
  1682. getWarnings(): WebpackError[];
  1683. getErrors(): WebpackError[];
  1684. /**
  1685. * This function allows you to run another instance of webpack inside of webpack however as
  1686. * a child with different settings and configurations (if desired) applied. It copies all hooks, plugins
  1687. * from parent (or top level compiler) and creates a child Compilation
  1688. */
  1689. createChildCompiler(
  1690. name: string,
  1691. outputOptions?: OutputNormalized,
  1692. plugins?: (
  1693. | ((this: Compiler, compiler: Compiler) => void)
  1694. | WebpackPluginInstance
  1695. )[]
  1696. ): Compiler;
  1697. executeModule(
  1698. module: Module,
  1699. options: ExecuteModuleOptions,
  1700. callback: (err?: null | WebpackError, result?: ExecuteModuleResult) => void
  1701. ): void;
  1702. checkConstraints(): void;
  1703. factorizeModule: {
  1704. (
  1705. options: FactorizeModuleOptions & { factoryResult?: false },
  1706. callback: (err?: null | WebpackError, result?: Module) => void
  1707. ): void;
  1708. (
  1709. options: FactorizeModuleOptions & { factoryResult: true },
  1710. callback: (
  1711. err?: null | WebpackError,
  1712. result?: ModuleFactoryResult
  1713. ) => void
  1714. ): void;
  1715. };
  1716. /**
  1717. * Add additional assets to the compilation.
  1718. */
  1719. static PROCESS_ASSETS_STAGE_ADDITIONAL: number;
  1720. /**
  1721. * Basic preprocessing of assets.
  1722. */
  1723. static PROCESS_ASSETS_STAGE_PRE_PROCESS: number;
  1724. /**
  1725. * Derive new assets from existing assets.
  1726. * Existing assets should not be treated as complete.
  1727. */
  1728. static PROCESS_ASSETS_STAGE_DERIVED: number;
  1729. /**
  1730. * Add additional sections to existing assets, like a banner or initialization code.
  1731. */
  1732. static PROCESS_ASSETS_STAGE_ADDITIONS: number;
  1733. /**
  1734. * Optimize existing assets in a general way.
  1735. */
  1736. static PROCESS_ASSETS_STAGE_OPTIMIZE: number;
  1737. /**
  1738. * Optimize the count of existing assets, e. g. by merging them.
  1739. * Only assets of the same type should be merged.
  1740. * For assets of different types see PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE.
  1741. */
  1742. static PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT: number;
  1743. /**
  1744. * Optimize the compatibility of existing assets, e. g. add polyfills or vendor-prefixes.
  1745. */
  1746. static PROCESS_ASSETS_STAGE_OPTIMIZE_COMPATIBILITY: number;
  1747. /**
  1748. * Optimize the size of existing assets, e. g. by minimizing or omitting whitespace.
  1749. */
  1750. static PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE: number;
  1751. /**
  1752. * Add development tooling to assets, e. g. by extracting a SourceMap.
  1753. */
  1754. static PROCESS_ASSETS_STAGE_DEV_TOOLING: number;
  1755. /**
  1756. * Optimize the count of existing assets, e. g. by inlining assets of into other assets.
  1757. * Only assets of different types should be inlined.
  1758. * For assets of the same type see PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT.
  1759. */
  1760. static PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE: number;
  1761. /**
  1762. * Summarize the list of existing assets
  1763. * e. g. creating an assets manifest of Service Workers.
  1764. */
  1765. static PROCESS_ASSETS_STAGE_SUMMARIZE: number;
  1766. /**
  1767. * Optimize the hashes of the assets, e. g. by generating real hashes of the asset content.
  1768. */
  1769. static PROCESS_ASSETS_STAGE_OPTIMIZE_HASH: number;
  1770. /**
  1771. * Optimize the transfer of existing assets, e. g. by preparing a compressed (gzip) file as separate asset.
  1772. */
  1773. static PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER: number;
  1774. /**
  1775. * Analyse existing assets.
  1776. */
  1777. static PROCESS_ASSETS_STAGE_ANALYSE: number;
  1778. /**
  1779. * Creating assets for reporting purposes.
  1780. */
  1781. static PROCESS_ASSETS_STAGE_REPORT: number;
  1782. }
  1783. declare interface CompilationAssets {
  1784. [index: string]: Source;
  1785. }
  1786. declare interface CompilationHooksAsyncWebAssemblyModulesPlugin {
  1787. renderModuleContent: SyncWaterfallHook<
  1788. [Source, Module, WebAssemblyRenderContext]
  1789. >;
  1790. }
  1791. declare interface CompilationHooksJavascriptModulesPlugin {
  1792. renderModuleContent: SyncWaterfallHook<[Source, Module, ChunkRenderContext]>;
  1793. renderModuleContainer: SyncWaterfallHook<
  1794. [Source, Module, ChunkRenderContext]
  1795. >;
  1796. renderModulePackage: SyncWaterfallHook<[Source, Module, ChunkRenderContext]>;
  1797. renderChunk: SyncWaterfallHook<[Source, RenderContext]>;
  1798. renderMain: SyncWaterfallHook<[Source, RenderContext]>;
  1799. renderContent: SyncWaterfallHook<[Source, RenderContext]>;
  1800. render: SyncWaterfallHook<[Source, RenderContext]>;
  1801. renderStartup: SyncWaterfallHook<[Source, Module, StartupRenderContext]>;
  1802. renderRequire: SyncWaterfallHook<[string, RenderBootstrapContext]>;
  1803. inlineInRuntimeBailout: SyncBailHook<
  1804. [Module, RenderBootstrapContext],
  1805. string
  1806. >;
  1807. embedInRuntimeBailout: SyncBailHook<[Module, RenderContext], string>;
  1808. strictRuntimeBailout: SyncBailHook<[RenderContext], string>;
  1809. chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
  1810. useSourceMap: SyncBailHook<[Chunk, RenderContext], boolean>;
  1811. }
  1812. declare interface CompilationHooksRealContentHashPlugin {
  1813. updateHash: SyncBailHook<[Buffer[], string], string>;
  1814. }
  1815. declare interface CompilationParams {
  1816. normalModuleFactory: NormalModuleFactory;
  1817. contextModuleFactory: ContextModuleFactory;
  1818. }
  1819. declare class Compiler {
  1820. constructor(context: string, options?: WebpackOptionsNormalized);
  1821. hooks: Readonly<{
  1822. initialize: SyncHook<[]>;
  1823. shouldEmit: SyncBailHook<[Compilation], boolean>;
  1824. done: AsyncSeriesHook<[Stats]>;
  1825. afterDone: SyncHook<[Stats]>;
  1826. additionalPass: AsyncSeriesHook<[]>;
  1827. beforeRun: AsyncSeriesHook<[Compiler]>;
  1828. run: AsyncSeriesHook<[Compiler]>;
  1829. emit: AsyncSeriesHook<[Compilation]>;
  1830. assetEmitted: AsyncSeriesHook<[string, AssetEmittedInfo]>;
  1831. afterEmit: AsyncSeriesHook<[Compilation]>;
  1832. thisCompilation: SyncHook<[Compilation, CompilationParams]>;
  1833. compilation: SyncHook<[Compilation, CompilationParams]>;
  1834. normalModuleFactory: SyncHook<[NormalModuleFactory]>;
  1835. contextModuleFactory: SyncHook<[ContextModuleFactory]>;
  1836. beforeCompile: AsyncSeriesHook<[CompilationParams]>;
  1837. compile: SyncHook<[CompilationParams]>;
  1838. make: AsyncParallelHook<[Compilation]>;
  1839. finishMake: AsyncParallelHook<[Compilation]>;
  1840. afterCompile: AsyncSeriesHook<[Compilation]>;
  1841. readRecords: AsyncSeriesHook<[]>;
  1842. emitRecords: AsyncSeriesHook<[]>;
  1843. watchRun: AsyncSeriesHook<[Compiler]>;
  1844. failed: SyncHook<[Error]>;
  1845. invalid: SyncHook<[null | string, number]>;
  1846. watchClose: SyncHook<[]>;
  1847. shutdown: AsyncSeriesHook<[]>;
  1848. infrastructureLog: SyncBailHook<[string, string, any[]], true>;
  1849. environment: SyncHook<[]>;
  1850. afterEnvironment: SyncHook<[]>;
  1851. afterPlugins: SyncHook<[Compiler]>;
  1852. afterResolvers: SyncHook<[Compiler]>;
  1853. entryOption: SyncBailHook<[string, EntryNormalized], boolean>;
  1854. }>;
  1855. webpack: typeof exports;
  1856. name?: string;
  1857. parentCompilation?: Compilation;
  1858. root: Compiler;
  1859. outputPath: string;
  1860. watching: Watching;
  1861. outputFileSystem: OutputFileSystem;
  1862. intermediateFileSystem: IntermediateFileSystem;
  1863. inputFileSystem: InputFileSystem;
  1864. watchFileSystem: WatchFileSystem;
  1865. recordsInputPath: null | string;
  1866. recordsOutputPath: null | string;
  1867. records: object;
  1868. managedPaths: Set<string | RegExp>;
  1869. immutablePaths: Set<string | RegExp>;
  1870. modifiedFiles: ReadonlySet<string>;
  1871. removedFiles: ReadonlySet<string>;
  1872. fileTimestamps: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">;
  1873. contextTimestamps: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">;
  1874. fsStartTime: number;
  1875. resolverFactory: ResolverFactory;
  1876. infrastructureLogger: any;
  1877. options: WebpackOptionsNormalized;
  1878. context: string;
  1879. requestShortener: RequestShortener;
  1880. cache: Cache;
  1881. moduleMemCaches?: Map<
  1882. Module,
  1883. {
  1884. buildInfo: object;
  1885. references: WeakMap<Dependency, Module>;
  1886. memCache: WeakTupleMap<any, any>;
  1887. }
  1888. >;
  1889. compilerPath: string;
  1890. running: boolean;
  1891. idle: boolean;
  1892. watchMode: boolean;
  1893. getCache(name: string): CacheFacade;
  1894. getInfrastructureLogger(name: string | (() => string)): WebpackLogger;
  1895. watch(watchOptions: WatchOptions, handler: CallbackFunction<Stats>): Watching;
  1896. run(callback: CallbackFunction<Stats>): void;
  1897. runAsChild(
  1898. callback: (
  1899. err?: null | Error,
  1900. entries?: Chunk[],
  1901. compilation?: Compilation
  1902. ) => any
  1903. ): void;
  1904. purgeInputFileSystem(): void;
  1905. emitAssets(compilation: Compilation, callback: CallbackFunction<void>): void;
  1906. emitRecords(callback: CallbackFunction<void>): void;
  1907. readRecords(callback: CallbackFunction<void>): void;
  1908. createChildCompiler(
  1909. compilation: Compilation,
  1910. compilerName: string,
  1911. compilerIndex: number,
  1912. outputOptions?: OutputNormalized,
  1913. plugins?: WebpackPluginInstance[]
  1914. ): Compiler;
  1915. isChild(): boolean;
  1916. createCompilation(params?: any): Compilation;
  1917. newCompilation(params: CompilationParams): Compilation;
  1918. createNormalModuleFactory(): NormalModuleFactory;
  1919. createContextModuleFactory(): ContextModuleFactory;
  1920. newCompilationParams(): {
  1921. normalModuleFactory: NormalModuleFactory;
  1922. contextModuleFactory: ContextModuleFactory;
  1923. };
  1924. compile(callback: CallbackFunction<Compilation>): void;
  1925. close(callback: CallbackFunction<void>): void;
  1926. }
  1927. declare class ConcatSource extends Source {
  1928. constructor(...args: (string | Source)[]);
  1929. getChildren(): Source[];
  1930. add(item: string | Source): void;
  1931. addAllSkipOptimizing(items: Source[]): void;
  1932. }
  1933. declare interface ConcatenatedModuleInfo {
  1934. index: number;
  1935. module: Module;
  1936. /**
  1937. * mapping from export name to symbol
  1938. */
  1939. exportMap: Map<string, string>;
  1940. /**
  1941. * mapping from export name to symbol
  1942. */
  1943. rawExportMap: Map<string, string>;
  1944. namespaceExportSymbol?: string;
  1945. }
  1946. declare interface ConcatenationBailoutReasonContext {
  1947. /**
  1948. * the module graph
  1949. */
  1950. moduleGraph: ModuleGraph;
  1951. /**
  1952. * the chunk graph
  1953. */
  1954. chunkGraph: ChunkGraph;
  1955. }
  1956. declare class ConcatenationScope {
  1957. constructor(
  1958. modulesMap: ModuleInfo[] | Map<Module, ModuleInfo>,
  1959. currentModule: ConcatenatedModuleInfo
  1960. );
  1961. isModuleInScope(module: Module): boolean;
  1962. registerExport(exportName: string, symbol: string): void;
  1963. registerRawExport(exportName: string, expression: string): void;
  1964. registerNamespaceExport(symbol: string): void;
  1965. createModuleReference(
  1966. module: Module,
  1967. __1: Partial<ModuleReferenceOptions>
  1968. ): string;
  1969. static isModuleReference(name: string): boolean;
  1970. static matchModuleReference(
  1971. name: string
  1972. ): ModuleReferenceOptions & { index: number };
  1973. static DEFAULT_EXPORT: string;
  1974. static NAMESPACE_OBJECT_EXPORT: string;
  1975. }
  1976. /**
  1977. * Options object as provided by the user.
  1978. */
  1979. declare interface Configuration {
  1980. /**
  1981. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  1982. */
  1983. amd?: false | { [index: string]: any };
  1984. /**
  1985. * Report the first error as a hard error instead of tolerating it.
  1986. */
  1987. bail?: boolean;
  1988. /**
  1989. * Cache generated modules and chunks to improve performance for multiple incremental builds.
  1990. */
  1991. cache?: boolean | FileCacheOptions | MemoryCacheOptions;
  1992. /**
  1993. * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.
  1994. */
  1995. context?: string;
  1996. /**
  1997. * References to other configurations to depend on.
  1998. */
  1999. dependencies?: string[];
  2000. /**
  2001. * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
  2002. */
  2003. devtool?: string | false;
  2004. /**
  2005. * The entry point(s) of the compilation.
  2006. */
  2007. entry?:
  2008. | string
  2009. | (() => string | EntryObject | string[] | Promise<EntryStatic>)
  2010. | EntryObject
  2011. | string[];
  2012. /**
  2013. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  2014. */
  2015. experiments?: Experiments;
  2016. /**
  2017. * Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`.
  2018. */
  2019. externals?:
  2020. | string
  2021. | RegExp
  2022. | ExternalItem[]
  2023. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  2024. | ((
  2025. data: ExternalItemFunctionData,
  2026. callback: (
  2027. err?: Error,
  2028. result?: string | boolean | string[] | { [index: string]: any }
  2029. ) => void
  2030. ) => void)
  2031. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
  2032. /**
  2033. * Enable presets of externals for specific targets.
  2034. */
  2035. externalsPresets?: ExternalsPresets;
  2036. /**
  2037. * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
  2038. */
  2039. externalsType?:
  2040. | "import"
  2041. | "var"
  2042. | "module"
  2043. | "assign"
  2044. | "this"
  2045. | "window"
  2046. | "self"
  2047. | "global"
  2048. | "commonjs"
  2049. | "commonjs2"
  2050. | "commonjs-module"
  2051. | "commonjs-static"
  2052. | "amd"
  2053. | "amd-require"
  2054. | "umd"
  2055. | "umd2"
  2056. | "jsonp"
  2057. | "system"
  2058. | "promise"
  2059. | "script"
  2060. | "node-commonjs";
  2061. /**
  2062. * Ignore specific warnings.
  2063. */
  2064. ignoreWarnings?: (
  2065. | RegExp
  2066. | {
  2067. /**
  2068. * A RegExp to select the origin file for the warning.
  2069. */
  2070. file?: RegExp;
  2071. /**
  2072. * A RegExp to select the warning message.
  2073. */
  2074. message?: RegExp;
  2075. /**
  2076. * A RegExp to select the origin module for the warning.
  2077. */
  2078. module?: RegExp;
  2079. }
  2080. | ((warning: WebpackError, compilation: Compilation) => boolean)
  2081. )[];
  2082. /**
  2083. * Options for infrastructure level logging.
  2084. */
  2085. infrastructureLogging?: InfrastructureLogging;
  2086. /**
  2087. * Custom values available in the loader context.
  2088. */
  2089. loader?: Loader;
  2090. /**
  2091. * Enable production optimizations or development hints.
  2092. */
  2093. mode?: "none" | "development" | "production";
  2094. /**
  2095. * Options affecting the normal modules (`NormalModuleFactory`).
  2096. */
  2097. module?: ModuleOptions;
  2098. /**
  2099. * Name of the configuration. Used when loading multiple configurations.
  2100. */
  2101. name?: string;
  2102. /**
  2103. * Include polyfills or mocks for various node stuff.
  2104. */
  2105. node?: false | NodeOptions;
  2106. /**
  2107. * Enables/Disables integrated optimizations.
  2108. */
  2109. optimization?: Optimization;
  2110. /**
  2111. * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  2112. */
  2113. output?: Output;
  2114. /**
  2115. * The number of parallel processed modules in the compilation.
  2116. */
  2117. parallelism?: number;
  2118. /**
  2119. * Configuration for web performance recommendations.
  2120. */
  2121. performance?: false | PerformanceOptions;
  2122. /**
  2123. * Add additional plugins to the compiler.
  2124. */
  2125. plugins?: (
  2126. | ((this: Compiler, compiler: Compiler) => void)
  2127. | WebpackPluginInstance
  2128. )[];
  2129. /**
  2130. * Capture timing information for each module.
  2131. */
  2132. profile?: boolean;
  2133. /**
  2134. * Store compiler state to a json file.
  2135. */
  2136. recordsInputPath?: string | false;
  2137. /**
  2138. * Load compiler state from a json file.
  2139. */
  2140. recordsOutputPath?: string | false;
  2141. /**
  2142. * Store/Load compiler state from/to a json file. This will result in persistent ids of modules and chunks. An absolute path is expected. `recordsPath` is used for `recordsInputPath` and `recordsOutputPath` if they left undefined.
  2143. */
  2144. recordsPath?: string | false;
  2145. /**
  2146. * Options for the resolver.
  2147. */
  2148. resolve?: ResolveOptionsWebpackOptions;
  2149. /**
  2150. * Options for the resolver when resolving loaders.
  2151. */
  2152. resolveLoader?: ResolveOptionsWebpackOptions;
  2153. /**
  2154. * Options affecting how file system snapshots are created and validated.
  2155. */
  2156. snapshot?: SnapshotOptions;
  2157. /**
  2158. * Stats options object or preset name.
  2159. */
  2160. stats?:
  2161. | boolean
  2162. | StatsOptions
  2163. | "none"
  2164. | "verbose"
  2165. | "summary"
  2166. | "errors-only"
  2167. | "errors-warnings"
  2168. | "minimal"
  2169. | "normal"
  2170. | "detailed";
  2171. /**
  2172. * Environment to build for. An array of environments to build for all of them when possible.
  2173. */
  2174. target?: string | false | string[];
  2175. /**
  2176. * Enter watch mode, which rebuilds on file change.
  2177. */
  2178. watch?: boolean;
  2179. /**
  2180. * Options for the watcher.
  2181. */
  2182. watchOptions?: WatchOptions;
  2183. }
  2184. type ConnectionState =
  2185. | boolean
  2186. | typeof TRANSITIVE_ONLY
  2187. | typeof CIRCULAR_CONNECTION;
  2188. declare class ConstDependency extends NullDependency {
  2189. constructor(
  2190. expression: string,
  2191. range: number | [number, number],
  2192. runtimeRequirements?: string[]
  2193. );
  2194. expression: string;
  2195. range: number | [number, number];
  2196. runtimeRequirements: null | Set<string>;
  2197. static Template: typeof ConstDependencyTemplate;
  2198. static NO_EXPORTS_REFERENCED: string[][];
  2199. static EXPORTS_OBJECT_REFERENCED: string[][];
  2200. static TRANSITIVE: typeof TRANSITIVE;
  2201. }
  2202. declare class ConstDependencyTemplate extends NullDependencyTemplate {
  2203. constructor();
  2204. }
  2205. declare interface Constructor {
  2206. new (...params: any[]): any;
  2207. }
  2208. declare class ConsumeSharedPlugin {
  2209. constructor(options: ConsumeSharedPluginOptions);
  2210. /**
  2211. * Apply the plugin
  2212. */
  2213. apply(compiler: Compiler): void;
  2214. }
  2215. /**
  2216. * Options for consuming shared modules.
  2217. */
  2218. declare interface ConsumeSharedPluginOptions {
  2219. /**
  2220. * Modules that should be consumed from share scope. When provided, property names are used to match requested modules in this compilation.
  2221. */
  2222. consumes: Consumes;
  2223. /**
  2224. * Share scope name used for all consumed modules (defaults to 'default').
  2225. */
  2226. shareScope?: string;
  2227. }
  2228. type Consumes = (string | ConsumesObject)[] | ConsumesObject;
  2229. /**
  2230. * Advanced configuration for modules that should be consumed from share scope.
  2231. */
  2232. declare interface ConsumesConfig {
  2233. /**
  2234. * Include the fallback module directly instead behind an async request. This allows to use fallback module in initial load too. All possible shared modules need to be eager too.
  2235. */
  2236. eager?: boolean;
  2237. /**
  2238. * Fallback module if no shared module is found in share scope. Defaults to the property name.
  2239. */
  2240. import?: string | false;
  2241. /**
  2242. * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
  2243. */
  2244. packageName?: string;
  2245. /**
  2246. * Version requirement from module in share scope.
  2247. */
  2248. requiredVersion?: string | false;
  2249. /**
  2250. * Module is looked up under this key from the share scope.
  2251. */
  2252. shareKey?: string;
  2253. /**
  2254. * Share scope name.
  2255. */
  2256. shareScope?: string;
  2257. /**
  2258. * Allow only a single version of the shared module in share scope (disabled by default).
  2259. */
  2260. singleton?: boolean;
  2261. /**
  2262. * Do not accept shared module if version is not valid (defaults to yes, if local fallback module is available and shared module is not a singleton, otherwise no, has no effect if there is no required version specified).
  2263. */
  2264. strictVersion?: boolean;
  2265. }
  2266. /**
  2267. * Modules that should be consumed from share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash.
  2268. */
  2269. declare interface ConsumesObject {
  2270. [index: string]: string | ConsumesConfig;
  2271. }
  2272. type ContainerOptionsFormat<T> =
  2273. | Record<string, string | string[] | T>
  2274. | (string | Record<string, string | string[] | T>)[];
  2275. declare class ContainerPlugin {
  2276. constructor(options: ContainerPluginOptions);
  2277. /**
  2278. * Apply the plugin
  2279. */
  2280. apply(compiler: Compiler): void;
  2281. }
  2282. declare interface ContainerPluginOptions {
  2283. /**
  2284. * Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.
  2285. */
  2286. exposes: Exposes;
  2287. /**
  2288. * The filename for this container relative path inside the `output.path` directory.
  2289. */
  2290. filename?: string;
  2291. /**
  2292. * Options for library.
  2293. */
  2294. library?: LibraryOptions;
  2295. /**
  2296. * The name for this container.
  2297. */
  2298. name: string;
  2299. /**
  2300. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  2301. */
  2302. runtime?: string | false;
  2303. /**
  2304. * The name of the share scope which is shared with the host (defaults to 'default').
  2305. */
  2306. shareScope?: string;
  2307. }
  2308. declare class ContainerReferencePlugin {
  2309. constructor(options: ContainerReferencePluginOptions);
  2310. /**
  2311. * Apply the plugin
  2312. */
  2313. apply(compiler: Compiler): void;
  2314. }
  2315. declare interface ContainerReferencePluginOptions {
  2316. /**
  2317. * The external type of the remote containers.
  2318. */
  2319. remoteType: ExternalsType;
  2320. /**
  2321. * Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.
  2322. */
  2323. remotes: Remotes;
  2324. /**
  2325. * The name of the share scope shared with all remotes (defaults to 'default').
  2326. */
  2327. shareScope?: string;
  2328. }
  2329. declare abstract class ContextElementDependency extends ModuleDependency {
  2330. referencedExports?: string[][];
  2331. }
  2332. declare class ContextExclusionPlugin {
  2333. constructor(negativeMatcher: RegExp);
  2334. negativeMatcher: RegExp;
  2335. /**
  2336. * Apply the plugin
  2337. */
  2338. apply(compiler: Compiler): void;
  2339. }
  2340. declare interface ContextFileSystemInfoEntry {
  2341. safeTime: number;
  2342. timestampHash?: string;
  2343. resolved?: ResolvedContextFileSystemInfoEntry;
  2344. symlinks?: Set<string>;
  2345. }
  2346. declare interface ContextHash {
  2347. hash: string;
  2348. resolved?: string;
  2349. symlinks?: Set<string>;
  2350. }
  2351. type ContextMode =
  2352. | "weak"
  2353. | "sync"
  2354. | "eager"
  2355. | "async-weak"
  2356. | "lazy"
  2357. | "lazy-once";
  2358. declare abstract class ContextModuleFactory extends ModuleFactory {
  2359. hooks: Readonly<{
  2360. beforeResolve: AsyncSeriesWaterfallHook<[any]>;
  2361. afterResolve: AsyncSeriesWaterfallHook<[any]>;
  2362. contextModuleFiles: SyncWaterfallHook<[string[]]>;
  2363. alternatives: FakeHook<
  2364. Pick<
  2365. AsyncSeriesWaterfallHook<[any[]]>,
  2366. "name" | "tap" | "tapAsync" | "tapPromise"
  2367. >
  2368. >;
  2369. alternativeRequests: AsyncSeriesWaterfallHook<
  2370. [any[], ContextModuleOptions]
  2371. >;
  2372. }>;
  2373. resolverFactory: ResolverFactory;
  2374. resolveDependencies(
  2375. fs: InputFileSystem,
  2376. options: ContextModuleOptions,
  2377. callback: (
  2378. err?: null | Error,
  2379. dependencies?: ContextElementDependency[]
  2380. ) => any
  2381. ): void;
  2382. }
  2383. declare interface ContextModuleOptions {
  2384. mode: ContextMode;
  2385. recursive: boolean;
  2386. regExp: RegExp;
  2387. namespaceObject?: boolean | "strict";
  2388. addon?: string;
  2389. chunkName?: string;
  2390. include?: RegExp;
  2391. exclude?: RegExp;
  2392. groupOptions?: RawChunkGroupOptions;
  2393. typePrefix?: string;
  2394. category?: string;
  2395. /**
  2396. * exports referenced from modules (won't be mangled)
  2397. */
  2398. referencedExports?: string[][];
  2399. resource: string | false | string[];
  2400. resourceQuery?: string;
  2401. resourceFragment?: string;
  2402. resolveOptions: any;
  2403. }
  2404. declare class ContextReplacementPlugin {
  2405. constructor(
  2406. resourceRegExp?: any,
  2407. newContentResource?: any,
  2408. newContentRecursive?: any,
  2409. newContentRegExp?: any
  2410. );
  2411. resourceRegExp: any;
  2412. newContentCallback: any;
  2413. newContentResource: any;
  2414. newContentCreateContextMap: any;
  2415. newContentRecursive: any;
  2416. newContentRegExp: any;
  2417. apply(compiler?: any): void;
  2418. }
  2419. declare interface ContextTimestampAndHash {
  2420. safeTime: number;
  2421. timestampHash?: string;
  2422. hash: string;
  2423. resolved?: ResolvedContextTimestampAndHash;
  2424. symlinks?: Set<string>;
  2425. }
  2426. type CreateStatsOptionsContext = KnownCreateStatsOptionsContext &
  2427. Record<string, any>;
  2428. /**
  2429. * Options for css handling.
  2430. */
  2431. declare interface CssExperimentOptions {
  2432. /**
  2433. * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
  2434. */
  2435. exportsOnly?: boolean;
  2436. }
  2437. type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
  2438. declare class DefinePlugin {
  2439. /**
  2440. * Create a new define plugin
  2441. */
  2442. constructor(definitions: Record<string, CodeValue>);
  2443. definitions: Record<string, CodeValue>;
  2444. /**
  2445. * Apply the plugin
  2446. */
  2447. apply(compiler: Compiler): void;
  2448. static runtimeValue(
  2449. fn: (arg0: {
  2450. module: NormalModule;
  2451. key: string;
  2452. readonly version?: string;
  2453. }) => CodeValuePrimitive,
  2454. options?: true | string[] | RuntimeValueOptions
  2455. ): RuntimeValue;
  2456. }
  2457. declare class DelegatedPlugin {
  2458. constructor(options?: any);
  2459. options: any;
  2460. /**
  2461. * Apply the plugin
  2462. */
  2463. apply(compiler: Compiler): void;
  2464. }
  2465. declare interface DepConstructor {
  2466. new (...args: any[]): Dependency;
  2467. }
  2468. declare abstract class DependenciesBlock {
  2469. dependencies: Dependency[];
  2470. blocks: AsyncDependenciesBlock[];
  2471. parent: DependenciesBlock;
  2472. getRootBlock(): DependenciesBlock;
  2473. /**
  2474. * Adds a DependencyBlock to DependencyBlock relationship.
  2475. * This is used for when a Module has a AsyncDependencyBlock tie (for code-splitting)
  2476. */
  2477. addBlock(block: AsyncDependenciesBlock): void;
  2478. addDependency(dependency: Dependency): void;
  2479. removeDependency(dependency: Dependency): void;
  2480. /**
  2481. * Removes all dependencies and blocks
  2482. */
  2483. clearDependenciesAndBlocks(): void;
  2484. updateHash(hash: Hash, context: UpdateHashContextDependency): void;
  2485. serialize(__0: { write: any }): void;
  2486. deserialize(__0: { read: any }): void;
  2487. }
  2488. declare interface DependenciesBlockLike {
  2489. dependencies: Dependency[];
  2490. blocks: AsyncDependenciesBlock[];
  2491. }
  2492. declare class Dependency {
  2493. constructor();
  2494. weak: boolean;
  2495. optional: boolean;
  2496. readonly type: string;
  2497. readonly category: string;
  2498. loc: DependencyLocation;
  2499. setLoc(
  2500. startLine?: any,
  2501. startColumn?: any,
  2502. endLine?: any,
  2503. endColumn?: any
  2504. ): void;
  2505. getContext(): undefined | string;
  2506. getResourceIdentifier(): null | string;
  2507. couldAffectReferencingModule(): boolean | typeof TRANSITIVE;
  2508. /**
  2509. * Returns the referenced module and export
  2510. */
  2511. getReference(moduleGraph: ModuleGraph): never;
  2512. /**
  2513. * Returns list of exports referenced by this dependency
  2514. */
  2515. getReferencedExports(
  2516. moduleGraph: ModuleGraph,
  2517. runtime: RuntimeSpec
  2518. ): (string[] | ReferencedExport)[];
  2519. getCondition(
  2520. moduleGraph: ModuleGraph
  2521. ):
  2522. | null
  2523. | false
  2524. | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState);
  2525. /**
  2526. * Returns the exported names
  2527. */
  2528. getExports(moduleGraph: ModuleGraph): undefined | ExportsSpec;
  2529. /**
  2530. * Returns warnings
  2531. */
  2532. getWarnings(moduleGraph: ModuleGraph): WebpackError[];
  2533. /**
  2534. * Returns errors
  2535. */
  2536. getErrors(moduleGraph: ModuleGraph): WebpackError[];
  2537. /**
  2538. * Update the hash
  2539. */
  2540. updateHash(hash: Hash, context: UpdateHashContextDependency): void;
  2541. /**
  2542. * implement this method to allow the occurrence order plugin to count correctly
  2543. */
  2544. getNumberOfIdOccurrences(): number;
  2545. getModuleEvaluationSideEffectsState(
  2546. moduleGraph: ModuleGraph
  2547. ): ConnectionState;
  2548. createIgnoredModule(context: string): Module;
  2549. serialize(__0: { write: any }): void;
  2550. deserialize(__0: { read: any }): void;
  2551. module: any;
  2552. readonly disconnect: any;
  2553. static NO_EXPORTS_REFERENCED: string[][];
  2554. static EXPORTS_OBJECT_REFERENCED: string[][];
  2555. static TRANSITIVE: typeof TRANSITIVE;
  2556. }
  2557. declare interface DependencyConstructor {
  2558. new (...args: any[]): Dependency;
  2559. }
  2560. type DependencyLocation = SyntheticDependencyLocation | RealDependencyLocation;
  2561. declare class DependencyTemplate {
  2562. constructor();
  2563. apply(
  2564. dependency: Dependency,
  2565. source: ReplaceSource,
  2566. templateContext: DependencyTemplateContext
  2567. ): void;
  2568. }
  2569. declare interface DependencyTemplateContext {
  2570. /**
  2571. * the runtime template
  2572. */
  2573. runtimeTemplate: RuntimeTemplate;
  2574. /**
  2575. * the dependency templates
  2576. */
  2577. dependencyTemplates: DependencyTemplates;
  2578. /**
  2579. * the module graph
  2580. */
  2581. moduleGraph: ModuleGraph;
  2582. /**
  2583. * the chunk graph
  2584. */
  2585. chunkGraph: ChunkGraph;
  2586. /**
  2587. * the requirements for runtime
  2588. */
  2589. runtimeRequirements: Set<string>;
  2590. /**
  2591. * current module
  2592. */
  2593. module: Module;
  2594. /**
  2595. * current runtimes, for which code is generated
  2596. */
  2597. runtime: RuntimeSpec;
  2598. /**
  2599. * mutable array of init fragments for the current module
  2600. */
  2601. initFragments: InitFragment<GenerateContext>[];
  2602. /**
  2603. * when in a concatenated module, information about other concatenated modules
  2604. */
  2605. concatenationScope?: ConcatenationScope;
  2606. /**
  2607. * the code generation results
  2608. */
  2609. codeGenerationResults: CodeGenerationResults;
  2610. }
  2611. declare abstract class DependencyTemplates {
  2612. get(dependency: DependencyConstructor): DependencyTemplate;
  2613. set(
  2614. dependency: DependencyConstructor,
  2615. dependencyTemplate: DependencyTemplate
  2616. ): void;
  2617. updateHash(part: string): void;
  2618. getHash(): string;
  2619. clone(): DependencyTemplates;
  2620. }
  2621. declare class DeterministicChunkIdsPlugin {
  2622. constructor(options?: any);
  2623. options: any;
  2624. /**
  2625. * Apply the plugin
  2626. */
  2627. apply(compiler: Compiler): void;
  2628. }
  2629. declare class DeterministicModuleIdsPlugin {
  2630. constructor(options?: {
  2631. /**
  2632. * context relative to which module identifiers are computed
  2633. */
  2634. context?: string;
  2635. /**
  2636. * selector function for modules
  2637. */
  2638. test?: (arg0: Module) => boolean;
  2639. /**
  2640. * maximum id length in digits (used as starting point)
  2641. */
  2642. maxLength?: number;
  2643. /**
  2644. * hash salt for ids
  2645. */
  2646. salt?: number;
  2647. /**
  2648. * do not increase the maxLength to find an optimal id space size
  2649. */
  2650. fixedLength?: boolean;
  2651. /**
  2652. * throw an error when id conflicts occur (instead of rehashing)
  2653. */
  2654. failOnConflict?: boolean;
  2655. });
  2656. options: {
  2657. /**
  2658. * context relative to which module identifiers are computed
  2659. */
  2660. context?: string;
  2661. /**
  2662. * selector function for modules
  2663. */
  2664. test?: (arg0: Module) => boolean;
  2665. /**
  2666. * maximum id length in digits (used as starting point)
  2667. */
  2668. maxLength?: number;
  2669. /**
  2670. * hash salt for ids
  2671. */
  2672. salt?: number;
  2673. /**
  2674. * do not increase the maxLength to find an optimal id space size
  2675. */
  2676. fixedLength?: boolean;
  2677. /**
  2678. * throw an error when id conflicts occur (instead of rehashing)
  2679. */
  2680. failOnConflict?: boolean;
  2681. };
  2682. /**
  2683. * Apply the plugin
  2684. */
  2685. apply(compiler: Compiler): void;
  2686. }
  2687. /**
  2688. * Options for the webpack-dev-server.
  2689. */
  2690. declare interface DevServer {
  2691. [index: string]: any;
  2692. }
  2693. declare class DllPlugin {
  2694. constructor(options: DllPluginOptions);
  2695. options: {
  2696. entryOnly: boolean;
  2697. /**
  2698. * Context of requests in the manifest file (defaults to the webpack context).
  2699. */
  2700. context?: string;
  2701. /**
  2702. * If true, manifest json file (output) will be formatted.
  2703. */
  2704. format?: boolean;
  2705. /**
  2706. * Name of the exposed dll function (external name, use value of 'output.library').
  2707. */
  2708. name?: string;
  2709. /**
  2710. * Absolute path to the manifest json file (output).
  2711. */
  2712. path: string;
  2713. /**
  2714. * Type of the dll bundle (external type, use value of 'output.libraryTarget').
  2715. */
  2716. type?: string;
  2717. };
  2718. /**
  2719. * Apply the plugin
  2720. */
  2721. apply(compiler: Compiler): void;
  2722. }
  2723. declare interface DllPluginOptions {
  2724. /**
  2725. * Context of requests in the manifest file (defaults to the webpack context).
  2726. */
  2727. context?: string;
  2728. /**
  2729. * If true, only entry points will be exposed (default: true).
  2730. */
  2731. entryOnly?: boolean;
  2732. /**
  2733. * If true, manifest json file (output) will be formatted.
  2734. */
  2735. format?: boolean;
  2736. /**
  2737. * Name of the exposed dll function (external name, use value of 'output.library').
  2738. */
  2739. name?: string;
  2740. /**
  2741. * Absolute path to the manifest json file (output).
  2742. */
  2743. path: string;
  2744. /**
  2745. * Type of the dll bundle (external type, use value of 'output.libraryTarget').
  2746. */
  2747. type?: string;
  2748. }
  2749. declare class DllReferencePlugin {
  2750. constructor(options: DllReferencePluginOptions);
  2751. options: DllReferencePluginOptions;
  2752. apply(compiler?: any): void;
  2753. }
  2754. type DllReferencePluginOptions =
  2755. | {
  2756. /**
  2757. * Context of requests in the manifest (or content property) as absolute path.
  2758. */
  2759. context?: string;
  2760. /**
  2761. * Extensions used to resolve modules in the dll bundle (only used when using 'scope').
  2762. */
  2763. extensions?: string[];
  2764. /**
  2765. * An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation.
  2766. */
  2767. manifest: string | DllReferencePluginOptionsManifest;
  2768. /**
  2769. * The name where the dll is exposed (external name, defaults to manifest.name).
  2770. */
  2771. name?: string;
  2772. /**
  2773. * Prefix which is used for accessing the content of the dll.
  2774. */
  2775. scope?: string;
  2776. /**
  2777. * How the dll is exposed (libraryTarget, defaults to manifest.type).
  2778. */
  2779. sourceType?:
  2780. | "var"
  2781. | "assign"
  2782. | "this"
  2783. | "window"
  2784. | "global"
  2785. | "commonjs"
  2786. | "commonjs2"
  2787. | "commonjs-module"
  2788. | "amd"
  2789. | "amd-require"
  2790. | "umd"
  2791. | "umd2"
  2792. | "jsonp"
  2793. | "system";
  2794. /**
  2795. * The way how the export of the dll bundle is used.
  2796. */
  2797. type?: "object" | "require";
  2798. }
  2799. | {
  2800. /**
  2801. * The mappings from request to module info.
  2802. */
  2803. content: DllReferencePluginOptionsContent;
  2804. /**
  2805. * Context of requests in the manifest (or content property) as absolute path.
  2806. */
  2807. context?: string;
  2808. /**
  2809. * Extensions used to resolve modules in the dll bundle (only used when using 'scope').
  2810. */
  2811. extensions?: string[];
  2812. /**
  2813. * The name where the dll is exposed (external name).
  2814. */
  2815. name: string;
  2816. /**
  2817. * Prefix which is used for accessing the content of the dll.
  2818. */
  2819. scope?: string;
  2820. /**
  2821. * How the dll is exposed (libraryTarget).
  2822. */
  2823. sourceType?:
  2824. | "var"
  2825. | "assign"
  2826. | "this"
  2827. | "window"
  2828. | "global"
  2829. | "commonjs"
  2830. | "commonjs2"
  2831. | "commonjs-module"
  2832. | "amd"
  2833. | "amd-require"
  2834. | "umd"
  2835. | "umd2"
  2836. | "jsonp"
  2837. | "system";
  2838. /**
  2839. * The way how the export of the dll bundle is used.
  2840. */
  2841. type?: "object" | "require";
  2842. };
  2843. /**
  2844. * The mappings from request to module info.
  2845. */
  2846. declare interface DllReferencePluginOptionsContent {
  2847. [index: string]: {
  2848. /**
  2849. * Meta information about the module.
  2850. */
  2851. buildMeta?: { [index: string]: any };
  2852. /**
  2853. * Information about the provided exports of the module.
  2854. */
  2855. exports?: true | string[];
  2856. /**
  2857. * Module ID.
  2858. */
  2859. id: string | number;
  2860. };
  2861. }
  2862. /**
  2863. * An object containing content, name and type.
  2864. */
  2865. declare interface DllReferencePluginOptionsManifest {
  2866. /**
  2867. * The mappings from request to module info.
  2868. */
  2869. content: DllReferencePluginOptionsContent;
  2870. /**
  2871. * The name where the dll is exposed (external name).
  2872. */
  2873. name?: string;
  2874. /**
  2875. * The type how the dll is exposed (external type).
  2876. */
  2877. type?:
  2878. | "var"
  2879. | "assign"
  2880. | "this"
  2881. | "window"
  2882. | "global"
  2883. | "commonjs"
  2884. | "commonjs2"
  2885. | "commonjs-module"
  2886. | "amd"
  2887. | "amd-require"
  2888. | "umd"
  2889. | "umd2"
  2890. | "jsonp"
  2891. | "system";
  2892. }
  2893. declare class DynamicEntryPlugin {
  2894. constructor(context: string, entry: () => Promise<EntryStaticNormalized>);
  2895. context: string;
  2896. entry: () => Promise<EntryStaticNormalized>;
  2897. /**
  2898. * Apply the plugin
  2899. */
  2900. apply(compiler: Compiler): void;
  2901. }
  2902. declare interface Effect {
  2903. type: string;
  2904. value: any;
  2905. }
  2906. declare class ElectronTargetPlugin {
  2907. constructor(context?: "main" | "preload" | "renderer");
  2908. /**
  2909. * Apply the plugin
  2910. */
  2911. apply(compiler: Compiler): void;
  2912. }
  2913. /**
  2914. * No generator options are supported for this module type.
  2915. */
  2916. declare interface EmptyGeneratorOptions {}
  2917. /**
  2918. * No parser options are supported for this module type.
  2919. */
  2920. declare interface EmptyParserOptions {}
  2921. declare class EnableChunkLoadingPlugin {
  2922. constructor(type: string);
  2923. type: string;
  2924. /**
  2925. * Apply the plugin
  2926. */
  2927. apply(compiler: Compiler): void;
  2928. static setEnabled(compiler: Compiler, type: string): void;
  2929. static checkEnabled(compiler: Compiler, type: string): void;
  2930. }
  2931. declare class EnableLibraryPlugin {
  2932. constructor(type: string);
  2933. type: string;
  2934. /**
  2935. * Apply the plugin
  2936. */
  2937. apply(compiler: Compiler): void;
  2938. static setEnabled(compiler: Compiler, type: string): void;
  2939. static checkEnabled(compiler: Compiler, type: string): void;
  2940. }
  2941. type Entry =
  2942. | string
  2943. | (() => string | EntryObject | string[] | Promise<EntryStatic>)
  2944. | EntryObject
  2945. | string[];
  2946. declare interface EntryData {
  2947. /**
  2948. * dependencies of the entrypoint that should be evaluated at startup
  2949. */
  2950. dependencies: Dependency[];
  2951. /**
  2952. * dependencies of the entrypoint that should be included but not evaluated
  2953. */
  2954. includeDependencies: Dependency[];
  2955. /**
  2956. * options of the entrypoint
  2957. */
  2958. options: EntryOptions;
  2959. }
  2960. declare abstract class EntryDependency extends ModuleDependency {}
  2961. /**
  2962. * An object with entry point description.
  2963. */
  2964. declare interface EntryDescription {
  2965. /**
  2966. * Enable/disable creating async chunks that are loaded on demand.
  2967. */
  2968. asyncChunks?: boolean;
  2969. /**
  2970. * Base uri for this entry.
  2971. */
  2972. baseUri?: string;
  2973. /**
  2974. * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
  2975. */
  2976. chunkLoading?: string | false;
  2977. /**
  2978. * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.
  2979. */
  2980. dependOn?: string | string[];
  2981. /**
  2982. * Specifies the filename of the output file on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
  2983. */
  2984. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  2985. /**
  2986. * Module(s) that are loaded upon startup.
  2987. */
  2988. import: EntryItem;
  2989. /**
  2990. * Specifies the layer in which modules of this entrypoint are placed.
  2991. */
  2992. layer?: null | string;
  2993. /**
  2994. * Options for library.
  2995. */
  2996. library?: LibraryOptions;
  2997. /**
  2998. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  2999. */
  3000. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3001. /**
  3002. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  3003. */
  3004. runtime?: string | false;
  3005. /**
  3006. * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
  3007. */
  3008. wasmLoading?: string | false;
  3009. }
  3010. /**
  3011. * An object with entry point description.
  3012. */
  3013. declare interface EntryDescriptionNormalized {
  3014. /**
  3015. * Enable/disable creating async chunks that are loaded on demand.
  3016. */
  3017. asyncChunks?: boolean;
  3018. /**
  3019. * Base uri for this entry.
  3020. */
  3021. baseUri?: string;
  3022. /**
  3023. * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
  3024. */
  3025. chunkLoading?: string | false;
  3026. /**
  3027. * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.
  3028. */
  3029. dependOn?: string[];
  3030. /**
  3031. * Specifies the filename of output files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
  3032. */
  3033. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3034. /**
  3035. * Module(s) that are loaded upon startup. The last one is exported.
  3036. */
  3037. import?: string[];
  3038. /**
  3039. * Specifies the layer in which modules of this entrypoint are placed.
  3040. */
  3041. layer?: null | string;
  3042. /**
  3043. * Options for library.
  3044. */
  3045. library?: LibraryOptions;
  3046. /**
  3047. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  3048. */
  3049. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3050. /**
  3051. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  3052. */
  3053. runtime?: string | false;
  3054. /**
  3055. * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
  3056. */
  3057. wasmLoading?: string | false;
  3058. }
  3059. type EntryItem = string | string[];
  3060. type EntryNormalized =
  3061. | (() => Promise<EntryStaticNormalized>)
  3062. | EntryStaticNormalized;
  3063. /**
  3064. * Multiple entry bundles are created. The key is the entry name. The value can be a string, an array or an entry description object.
  3065. */
  3066. declare interface EntryObject {
  3067. [index: string]: string | string[] | EntryDescription;
  3068. }
  3069. declare class EntryOptionPlugin {
  3070. constructor();
  3071. apply(compiler: Compiler): void;
  3072. static applyEntryOption(
  3073. compiler: Compiler,
  3074. context: string,
  3075. entry: EntryNormalized
  3076. ): void;
  3077. static entryDescriptionToOptions(
  3078. compiler: Compiler,
  3079. name: string,
  3080. desc: EntryDescriptionNormalized
  3081. ): EntryOptions;
  3082. }
  3083. type EntryOptions = { name?: string } & Omit<
  3084. EntryDescriptionNormalized,
  3085. "import"
  3086. >;
  3087. declare class EntryPlugin {
  3088. /**
  3089. * An entry plugin which will handle
  3090. * creation of the EntryDependency
  3091. */
  3092. constructor(context: string, entry: string, options?: string | EntryOptions);
  3093. context: string;
  3094. entry: string;
  3095. options: string | EntryOptions;
  3096. /**
  3097. * Apply the plugin
  3098. */
  3099. apply(compiler: Compiler): void;
  3100. static createDependency(
  3101. entry: string,
  3102. options: string | EntryOptions
  3103. ): EntryDependency;
  3104. }
  3105. type EntryStatic = string | EntryObject | string[];
  3106. /**
  3107. * Multiple entry bundles are created. The key is the entry name. The value is an entry description object.
  3108. */
  3109. declare interface EntryStaticNormalized {
  3110. [index: string]: EntryDescriptionNormalized;
  3111. }
  3112. declare abstract class Entrypoint extends ChunkGroup {
  3113. /**
  3114. * Sets the runtimeChunk for an entrypoint.
  3115. */
  3116. setRuntimeChunk(chunk: Chunk): void;
  3117. /**
  3118. * Fetches the chunk reference containing the webpack bootstrap code
  3119. */
  3120. getRuntimeChunk(): null | Chunk;
  3121. /**
  3122. * Sets the chunk with the entrypoint modules for an entrypoint.
  3123. */
  3124. setEntrypointChunk(chunk: Chunk): void;
  3125. /**
  3126. * Returns the chunk which contains the entrypoint modules
  3127. * (or at least the execution of them)
  3128. */
  3129. getEntrypointChunk(): Chunk;
  3130. }
  3131. /**
  3132. * The abilities of the environment where the webpack generated code should run.
  3133. */
  3134. declare interface Environment {
  3135. /**
  3136. * The environment supports arrow functions ('() => { ... }').
  3137. */
  3138. arrowFunction?: boolean;
  3139. /**
  3140. * The environment supports BigInt as literal (123n).
  3141. */
  3142. bigIntLiteral?: boolean;
  3143. /**
  3144. * The environment supports const and let for variable declarations.
  3145. */
  3146. const?: boolean;
  3147. /**
  3148. * The environment supports destructuring ('{ a, b } = obj').
  3149. */
  3150. destructuring?: boolean;
  3151. /**
  3152. * The environment supports an async import() function to import EcmaScript modules.
  3153. */
  3154. dynamicImport?: boolean;
  3155. /**
  3156. * The environment supports 'for of' iteration ('for (const x of array) { ... }').
  3157. */
  3158. forOf?: boolean;
  3159. /**
  3160. * The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from '...').
  3161. */
  3162. module?: boolean;
  3163. /**
  3164. * The environment supports optional chaining ('obj?.a' or 'obj?.()').
  3165. */
  3166. optionalChaining?: boolean;
  3167. /**
  3168. * The environment supports template literals.
  3169. */
  3170. templateLiteral?: boolean;
  3171. }
  3172. declare class EnvironmentPlugin {
  3173. constructor(...keys: any[]);
  3174. keys: any[];
  3175. defaultValues: any;
  3176. /**
  3177. * Apply the plugin
  3178. */
  3179. apply(compiler: Compiler): void;
  3180. }
  3181. declare interface Etag {
  3182. toString: () => string;
  3183. }
  3184. declare class EvalDevToolModulePlugin {
  3185. constructor(options?: any);
  3186. namespace: any;
  3187. sourceUrlComment: any;
  3188. moduleFilenameTemplate: any;
  3189. /**
  3190. * Apply the plugin
  3191. */
  3192. apply(compiler: Compiler): void;
  3193. }
  3194. declare class EvalSourceMapDevToolPlugin {
  3195. constructor(inputOptions: string | SourceMapDevToolPluginOptions);
  3196. sourceMapComment: string;
  3197. moduleFilenameTemplate: string | Function;
  3198. namespace: string;
  3199. options: SourceMapDevToolPluginOptions;
  3200. /**
  3201. * Apply the plugin
  3202. */
  3203. apply(compiler: Compiler): void;
  3204. }
  3205. declare interface ExecuteModuleArgument {
  3206. module: Module;
  3207. moduleObject?: { id: string; exports: any; loaded: boolean };
  3208. preparedInfo: any;
  3209. codeGenerationResult: CodeGenerationResult;
  3210. }
  3211. declare interface ExecuteModuleContext {
  3212. assets: Map<string, { source: Source; info: AssetInfo }>;
  3213. chunk: Chunk;
  3214. chunkGraph: ChunkGraph;
  3215. __webpack_require__?: (arg0: string) => any;
  3216. }
  3217. declare interface ExecuteModuleOptions {
  3218. entryOptions?: EntryOptions;
  3219. }
  3220. declare interface ExecuteModuleResult {
  3221. exports: any;
  3222. cacheable: boolean;
  3223. assets: Map<string, { source: Source; info: AssetInfo }>;
  3224. fileDependencies: LazySet<string>;
  3225. contextDependencies: LazySet<string>;
  3226. missingDependencies: LazySet<string>;
  3227. buildDependencies: LazySet<string>;
  3228. }
  3229. type Experiments = ExperimentsCommon & ExperimentsExtra;
  3230. /**
  3231. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  3232. */
  3233. declare interface ExperimentsCommon {
  3234. /**
  3235. * Support WebAssembly as asynchronous EcmaScript Module.
  3236. */
  3237. asyncWebAssembly?: boolean;
  3238. /**
  3239. * Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.
  3240. */
  3241. backCompat?: boolean;
  3242. /**
  3243. * Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.
  3244. */
  3245. cacheUnaffected?: boolean;
  3246. /**
  3247. * Apply defaults of next major version.
  3248. */
  3249. futureDefaults?: boolean;
  3250. /**
  3251. * Enable module layers.
  3252. */
  3253. layers?: boolean;
  3254. /**
  3255. * Allow output javascript files as module source type.
  3256. */
  3257. outputModule?: boolean;
  3258. /**
  3259. * Support WebAssembly as synchronous EcmaScript Module (outdated).
  3260. */
  3261. syncWebAssembly?: boolean;
  3262. /**
  3263. * Allow using top-level-await in EcmaScript Modules.
  3264. */
  3265. topLevelAwait?: boolean;
  3266. }
  3267. /**
  3268. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  3269. */
  3270. declare interface ExperimentsExtra {
  3271. /**
  3272. * Build http(s): urls using a lockfile and resource content cache.
  3273. */
  3274. buildHttp?: HttpUriOptions | (string | RegExp | ((uri: string) => boolean))[];
  3275. /**
  3276. * Enable css support.
  3277. */
  3278. css?: boolean | CssExperimentOptions;
  3279. /**
  3280. * Compile entrypoints and import()s only when they are accessed.
  3281. */
  3282. lazyCompilation?: boolean | LazyCompilationOptions;
  3283. }
  3284. type ExperimentsNormalized = ExperimentsCommon & ExperimentsNormalizedExtra;
  3285. /**
  3286. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  3287. */
  3288. declare interface ExperimentsNormalizedExtra {
  3289. /**
  3290. * Build http(s): urls using a lockfile and resource content cache.
  3291. */
  3292. buildHttp?: HttpUriOptions;
  3293. /**
  3294. * Enable css support.
  3295. */
  3296. css?: CssExperimentOptions;
  3297. /**
  3298. * Compile entrypoints and import()s only when they are accessed.
  3299. */
  3300. lazyCompilation?: LazyCompilationOptions;
  3301. }
  3302. declare abstract class ExportInfo {
  3303. name: string;
  3304. /**
  3305. * true: it is provided
  3306. * false: it is not provided
  3307. * null: only the runtime knows if it is provided
  3308. * undefined: it was not determined if it is provided
  3309. */
  3310. provided?: null | boolean;
  3311. /**
  3312. * is the export a terminal binding that should be checked for export star conflicts
  3313. */
  3314. terminalBinding: boolean;
  3315. /**
  3316. * true: it can be mangled
  3317. * false: is can not be mangled
  3318. * undefined: it was not determined if it can be mangled
  3319. */
  3320. canMangleProvide?: boolean;
  3321. /**
  3322. * true: it can be mangled
  3323. * false: is can not be mangled
  3324. * undefined: it was not determined if it can be mangled
  3325. */
  3326. canMangleUse?: boolean;
  3327. exportsInfoOwned: boolean;
  3328. exportsInfo?: ExportsInfo;
  3329. readonly canMangle?: boolean;
  3330. setUsedInUnknownWay(runtime: RuntimeSpec): boolean;
  3331. setUsedWithoutInfo(runtime: RuntimeSpec): boolean;
  3332. setHasUseInfo(): void;
  3333. setUsedConditionally(
  3334. condition: (arg0: UsageStateType) => boolean,
  3335. newValue: UsageStateType,
  3336. runtime: RuntimeSpec
  3337. ): boolean;
  3338. setUsed(newValue: UsageStateType, runtime: RuntimeSpec): boolean;
  3339. unsetTarget(key?: any): boolean;
  3340. setTarget(
  3341. key: any,
  3342. connection: ModuleGraphConnection,
  3343. exportName?: string[],
  3344. priority?: number
  3345. ): boolean;
  3346. getUsed(runtime: RuntimeSpec): UsageStateType;
  3347. /**
  3348. * get used name
  3349. */
  3350. getUsedName(
  3351. fallbackName: undefined | string,
  3352. runtime: RuntimeSpec
  3353. ): string | false;
  3354. hasUsedName(): boolean;
  3355. /**
  3356. * Sets the mangled name of this export
  3357. */
  3358. setUsedName(name: string): void;
  3359. getTerminalBinding(
  3360. moduleGraph: ModuleGraph,
  3361. resolveTargetFilter?: (arg0: {
  3362. module: Module;
  3363. export?: string[];
  3364. }) => boolean
  3365. ): undefined | ExportsInfo | ExportInfo;
  3366. isReexport(): undefined | boolean;
  3367. findTarget(
  3368. moduleGraph: ModuleGraph,
  3369. validTargetModuleFilter: (arg0: Module) => boolean
  3370. ): undefined | false | { module: Module; export?: string[] };
  3371. getTarget(
  3372. moduleGraph: ModuleGraph,
  3373. resolveTargetFilter?: (arg0: {
  3374. module: Module;
  3375. export?: string[];
  3376. }) => boolean
  3377. ): undefined | { module: Module; export?: string[] };
  3378. /**
  3379. * Move the target forward as long resolveTargetFilter is fulfilled
  3380. */
  3381. moveTarget(
  3382. moduleGraph: ModuleGraph,
  3383. resolveTargetFilter: (arg0: {
  3384. module: Module;
  3385. export?: string[];
  3386. }) => boolean,
  3387. updateOriginalConnection?: (arg0: {
  3388. module: Module;
  3389. export?: string[];
  3390. }) => ModuleGraphConnection
  3391. ): undefined | { module: Module; export?: string[] };
  3392. createNestedExportsInfo(): undefined | ExportsInfo;
  3393. getNestedExportsInfo(): undefined | ExportsInfo;
  3394. hasInfo(baseInfo?: any, runtime?: any): boolean;
  3395. updateHash(hash?: any, runtime?: any): void;
  3396. getUsedInfo(): string;
  3397. getProvidedInfo():
  3398. | "no provided info"
  3399. | "maybe provided (runtime-defined)"
  3400. | "provided"
  3401. | "not provided";
  3402. getRenameInfo(): string;
  3403. }
  3404. declare interface ExportSpec {
  3405. /**
  3406. * the name of the export
  3407. */
  3408. name: string;
  3409. /**
  3410. * can the export be renamed (defaults to true)
  3411. */
  3412. canMangle?: boolean;
  3413. /**
  3414. * is the export a terminal binding that should be checked for export star conflicts
  3415. */
  3416. terminalBinding?: boolean;
  3417. /**
  3418. * nested exports
  3419. */
  3420. exports?: (string | ExportSpec)[];
  3421. /**
  3422. * when reexported: from which module
  3423. */
  3424. from?: ModuleGraphConnection;
  3425. /**
  3426. * when reexported: from which export
  3427. */
  3428. export?: null | string[];
  3429. /**
  3430. * when reexported: with which priority
  3431. */
  3432. priority?: number;
  3433. /**
  3434. * export is not visible, because another export blends over it
  3435. */
  3436. hidden?: boolean;
  3437. }
  3438. type ExportedVariableInfo = string | ScopeInfo | VariableInfo;
  3439. declare abstract class ExportsInfo {
  3440. readonly ownedExports: Iterable<ExportInfo>;
  3441. readonly orderedOwnedExports: Iterable<ExportInfo>;
  3442. readonly exports: Iterable<ExportInfo>;
  3443. readonly orderedExports: Iterable<ExportInfo>;
  3444. readonly otherExportsInfo: ExportInfo;
  3445. setRedirectNamedTo(exportsInfo?: any): boolean;
  3446. setHasProvideInfo(): void;
  3447. setHasUseInfo(): void;
  3448. getOwnExportInfo(name: string): ExportInfo;
  3449. getExportInfo(name: string): ExportInfo;
  3450. getReadOnlyExportInfo(name: string): ExportInfo;
  3451. getReadOnlyExportInfoRecursive(name: string[]): undefined | ExportInfo;
  3452. getNestedExportsInfo(name?: string[]): undefined | ExportsInfo;
  3453. setUnknownExportsProvided(
  3454. canMangle?: boolean,
  3455. excludeExports?: Set<string>,
  3456. targetKey?: any,
  3457. targetModule?: ModuleGraphConnection,
  3458. priority?: number
  3459. ): boolean;
  3460. setUsedInUnknownWay(runtime: RuntimeSpec): boolean;
  3461. setUsedWithoutInfo(runtime: RuntimeSpec): boolean;
  3462. setAllKnownExportsUsed(runtime: RuntimeSpec): boolean;
  3463. setUsedForSideEffectsOnly(runtime: RuntimeSpec): boolean;
  3464. isUsed(runtime: RuntimeSpec): boolean;
  3465. isModuleUsed(runtime: RuntimeSpec): boolean;
  3466. getUsedExports(runtime: RuntimeSpec): null | boolean | SortableSet<string>;
  3467. getProvidedExports(): null | true | string[];
  3468. getRelevantExports(runtime: RuntimeSpec): ExportInfo[];
  3469. isExportProvided(name: string | string[]): undefined | null | boolean;
  3470. getUsageKey(runtime: RuntimeSpec): string;
  3471. isEquallyUsed(runtimeA: RuntimeSpec, runtimeB: RuntimeSpec): boolean;
  3472. getUsed(name: string | string[], runtime: RuntimeSpec): UsageStateType;
  3473. getUsedName(
  3474. name: string | string[],
  3475. runtime: RuntimeSpec
  3476. ): string | false | string[];
  3477. updateHash(hash: Hash, runtime: RuntimeSpec): void;
  3478. getRestoreProvidedData(): any;
  3479. restoreProvided(__0: {
  3480. otherProvided: any;
  3481. otherCanMangleProvide: any;
  3482. otherTerminalBinding: any;
  3483. exports: any;
  3484. }): void;
  3485. }
  3486. declare interface ExportsSpec {
  3487. /**
  3488. * exported names, true for unknown exports or null for no exports
  3489. */
  3490. exports: null | true | (string | ExportSpec)[];
  3491. /**
  3492. * when exports = true, list of unaffected exports
  3493. */
  3494. excludeExports?: Set<string>;
  3495. /**
  3496. * list of maybe prior exposed, but now hidden exports
  3497. */
  3498. hideExports?: Set<string>;
  3499. /**
  3500. * when reexported: from which module
  3501. */
  3502. from?: ModuleGraphConnection;
  3503. /**
  3504. * when reexported: with which priority
  3505. */
  3506. priority?: number;
  3507. /**
  3508. * can the export be renamed (defaults to true)
  3509. */
  3510. canMangle?: boolean;
  3511. /**
  3512. * are the exports terminal bindings that should be checked for export star conflicts
  3513. */
  3514. terminalBinding?: boolean;
  3515. /**
  3516. * module on which the result depends on
  3517. */
  3518. dependencies?: Module[];
  3519. }
  3520. type Exposes = (string | ExposesObject)[] | ExposesObject;
  3521. /**
  3522. * Advanced configuration for modules that should be exposed by this container.
  3523. */
  3524. declare interface ExposesConfig {
  3525. /**
  3526. * Request to a module that should be exposed by this container.
  3527. */
  3528. import: string | string[];
  3529. /**
  3530. * Custom chunk name for the exposed module.
  3531. */
  3532. name?: string;
  3533. }
  3534. /**
  3535. * Modules that should be exposed by this container. Property names are used as public paths.
  3536. */
  3537. declare interface ExposesObject {
  3538. [index: string]: string | ExposesConfig | string[];
  3539. }
  3540. type Expression =
  3541. | UnaryExpression
  3542. | ThisExpression
  3543. | ArrayExpression
  3544. | ObjectExpression
  3545. | FunctionExpression
  3546. | ArrowFunctionExpression
  3547. | YieldExpression
  3548. | SimpleLiteral
  3549. | RegExpLiteral
  3550. | BigIntLiteral
  3551. | UpdateExpression
  3552. | BinaryExpression
  3553. | AssignmentExpression
  3554. | LogicalExpression
  3555. | MemberExpression
  3556. | ConditionalExpression
  3557. | SimpleCallExpression
  3558. | NewExpression
  3559. | SequenceExpression
  3560. | TemplateLiteral
  3561. | TaggedTemplateExpression
  3562. | ClassExpression
  3563. | MetaProperty
  3564. | Identifier
  3565. | AwaitExpression
  3566. | ImportExpression
  3567. | ChainExpression;
  3568. declare interface ExpressionExpressionInfo {
  3569. type: "expression";
  3570. rootInfo: string | VariableInfo;
  3571. name: string;
  3572. getMembers: () => string[];
  3573. getMembersOptionals: () => boolean[];
  3574. }
  3575. type ExternalItem =
  3576. | string
  3577. | RegExp
  3578. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  3579. | ((
  3580. data: ExternalItemFunctionData,
  3581. callback: (
  3582. err?: Error,
  3583. result?: string | boolean | string[] | { [index: string]: any }
  3584. ) => void
  3585. ) => void)
  3586. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
  3587. /**
  3588. * Data object passed as argument when a function is set for 'externals'.
  3589. */
  3590. declare interface ExternalItemFunctionData {
  3591. /**
  3592. * The directory in which the request is placed.
  3593. */
  3594. context?: string;
  3595. /**
  3596. * Contextual information.
  3597. */
  3598. contextInfo?: ModuleFactoryCreateDataContextInfo;
  3599. /**
  3600. * The category of the referencing dependencies.
  3601. */
  3602. dependencyType?: string;
  3603. /**
  3604. * Get a resolve function with the current resolver options.
  3605. */
  3606. getResolve?: (
  3607. options?: ResolveOptionsWebpackOptions
  3608. ) =>
  3609. | ((
  3610. context: string,
  3611. request: string,
  3612. callback: (err?: Error, result?: string) => void
  3613. ) => void)
  3614. | ((context: string, request: string) => Promise<string>);
  3615. /**
  3616. * The request as written by the user in the require/import expression/statement.
  3617. */
  3618. request?: string;
  3619. }
  3620. /**
  3621. * If an dependency matches exactly a property of the object, the property value is used as dependency.
  3622. */
  3623. declare interface ExternalItemObjectKnown {
  3624. /**
  3625. * Specify externals depending on the layer.
  3626. */
  3627. byLayer?:
  3628. | { [index: string]: ExternalItem }
  3629. | ((layer: null | string) => ExternalItem);
  3630. }
  3631. /**
  3632. * If an dependency matches exactly a property of the object, the property value is used as dependency.
  3633. */
  3634. declare interface ExternalItemObjectUnknown {
  3635. [index: string]: ExternalItemValue;
  3636. }
  3637. type ExternalItemValue = string | boolean | string[] | { [index: string]: any };
  3638. declare class ExternalModule extends Module {
  3639. constructor(request?: any, type?: any, userRequest?: any);
  3640. request: string | string[] | Record<string, string | string[]>;
  3641. externalType: string;
  3642. userRequest: string;
  3643. restoreFromUnsafeCache(
  3644. unsafeCacheData?: any,
  3645. normalModuleFactory?: any
  3646. ): void;
  3647. }
  3648. declare interface ExternalModuleInfo {
  3649. index: number;
  3650. module: Module;
  3651. }
  3652. type Externals =
  3653. | string
  3654. | RegExp
  3655. | ExternalItem[]
  3656. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  3657. | ((
  3658. data: ExternalItemFunctionData,
  3659. callback: (
  3660. err?: Error,
  3661. result?: string | boolean | string[] | { [index: string]: any }
  3662. ) => void
  3663. ) => void)
  3664. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
  3665. declare class ExternalsPlugin {
  3666. constructor(type: undefined | string, externals: Externals);
  3667. type?: string;
  3668. externals: Externals;
  3669. /**
  3670. * Apply the plugin
  3671. */
  3672. apply(compiler: Compiler): void;
  3673. }
  3674. /**
  3675. * Enable presets of externals for specific targets.
  3676. */
  3677. declare interface ExternalsPresets {
  3678. /**
  3679. * Treat common electron built-in modules in main and preload context like 'electron', 'ipc' or 'shell' as external and load them via require() when used.
  3680. */
  3681. electron?: boolean;
  3682. /**
  3683. * Treat electron built-in modules in the main context like 'app', 'ipc-main' or 'shell' as external and load them via require() when used.
  3684. */
  3685. electronMain?: boolean;
  3686. /**
  3687. * Treat electron built-in modules in the preload context like 'web-frame', 'ipc-renderer' or 'shell' as external and load them via require() when used.
  3688. */
  3689. electronPreload?: boolean;
  3690. /**
  3691. * Treat electron built-in modules in the renderer context like 'web-frame', 'ipc-renderer' or 'shell' as external and load them via require() when used.
  3692. */
  3693. electronRenderer?: boolean;
  3694. /**
  3695. * Treat node.js built-in modules like fs, path or vm as external and load them via require() when used.
  3696. */
  3697. node?: boolean;
  3698. /**
  3699. * Treat NW.js legacy nw.gui module as external and load it via require() when used.
  3700. */
  3701. nwjs?: boolean;
  3702. /**
  3703. * Treat references to 'http(s)://...' and 'std:...' as external and load them via import when used (Note that this changes execution order as externals are executed before any other code in the chunk).
  3704. */
  3705. web?: boolean;
  3706. /**
  3707. * Treat references to 'http(s)://...' and 'std:...' as external and load them via async import() when used (Note that this external type is an async module, which has various effects on the execution).
  3708. */
  3709. webAsync?: boolean;
  3710. }
  3711. type ExternalsType =
  3712. | "import"
  3713. | "var"
  3714. | "module"
  3715. | "assign"
  3716. | "this"
  3717. | "window"
  3718. | "self"
  3719. | "global"
  3720. | "commonjs"
  3721. | "commonjs2"
  3722. | "commonjs-module"
  3723. | "commonjs-static"
  3724. | "amd"
  3725. | "amd-require"
  3726. | "umd"
  3727. | "umd2"
  3728. | "jsonp"
  3729. | "system"
  3730. | "promise"
  3731. | "script"
  3732. | "node-commonjs";
  3733. declare interface FactorizeModuleOptions {
  3734. currentProfile: ModuleProfile;
  3735. factory: ModuleFactory;
  3736. dependencies: Dependency[];
  3737. /**
  3738. * return full ModuleFactoryResult instead of only module
  3739. */
  3740. factoryResult?: boolean;
  3741. originModule: null | Module;
  3742. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  3743. context?: string;
  3744. }
  3745. type FakeHook<T> = T & FakeHookMarker;
  3746. declare interface FakeHookMarker {}
  3747. declare interface FallbackCacheGroup {
  3748. chunksFilter: (chunk: Chunk) => boolean;
  3749. minSize: SplitChunksSizes;
  3750. maxAsyncSize: SplitChunksSizes;
  3751. maxInitialSize: SplitChunksSizes;
  3752. automaticNameDelimiter: string;
  3753. }
  3754. declare class FetchCompileAsyncWasmPlugin {
  3755. constructor();
  3756. /**
  3757. * Apply the plugin
  3758. */
  3759. apply(compiler: Compiler): void;
  3760. }
  3761. declare class FetchCompileWasmPlugin {
  3762. constructor(options?: any);
  3763. options: any;
  3764. /**
  3765. * Apply the plugin
  3766. */
  3767. apply(compiler: Compiler): void;
  3768. }
  3769. /**
  3770. * Options object for persistent file-based caching.
  3771. */
  3772. declare interface FileCacheOptions {
  3773. /**
  3774. * Allows to collect unused memory allocated during deserialization. This requires copying data into smaller buffers and has a performance cost.
  3775. */
  3776. allowCollectingMemory?: boolean;
  3777. /**
  3778. * Dependencies the build depends on (in multiple categories, default categories: 'defaultWebpack').
  3779. */
  3780. buildDependencies?: { [index: string]: string[] };
  3781. /**
  3782. * Base directory for the cache (defaults to node_modules/.cache/webpack).
  3783. */
  3784. cacheDirectory?: string;
  3785. /**
  3786. * Locations for the cache (defaults to cacheDirectory / name).
  3787. */
  3788. cacheLocation?: string;
  3789. /**
  3790. * Compression type used for the cache files.
  3791. */
  3792. compression?: false | "gzip" | "brotli";
  3793. /**
  3794. * Algorithm used for generation the hash (see node.js crypto package).
  3795. */
  3796. hashAlgorithm?: string;
  3797. /**
  3798. * Time in ms after which idle period the cache storing should happen.
  3799. */
  3800. idleTimeout?: number;
  3801. /**
  3802. * Time in ms after which idle period the cache storing should happen when larger changes has been detected (cumulative build time > 2 x avg cache store time).
  3803. */
  3804. idleTimeoutAfterLargeChanges?: number;
  3805. /**
  3806. * Time in ms after which idle period the initial cache storing should happen.
  3807. */
  3808. idleTimeoutForInitialStore?: number;
  3809. /**
  3810. * List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
  3811. */
  3812. immutablePaths?: (string | RegExp)[];
  3813. /**
  3814. * List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
  3815. */
  3816. managedPaths?: (string | RegExp)[];
  3817. /**
  3818. * Time for which unused cache entries stay in the filesystem cache at minimum (in milliseconds).
  3819. */
  3820. maxAge?: number;
  3821. /**
  3822. * Number of generations unused cache entries stay in memory cache at minimum (0 = no memory cache used, 1 = may be removed after unused for a single compilation, ..., Infinity: kept forever). Cache entries will be deserialized from disk when removed from memory cache.
  3823. */
  3824. maxMemoryGenerations?: number;
  3825. /**
  3826. * Additionally cache computation of modules that are unchanged and reference only unchanged modules in memory.
  3827. */
  3828. memoryCacheUnaffected?: boolean;
  3829. /**
  3830. * Name for the cache. Different names will lead to different coexisting caches.
  3831. */
  3832. name?: string;
  3833. /**
  3834. * Track and log detailed timing information for individual cache items.
  3835. */
  3836. profile?: boolean;
  3837. /**
  3838. * When to store data to the filesystem. (pack: Store data when compiler is idle in a single file).
  3839. */
  3840. store?: "pack";
  3841. /**
  3842. * Filesystem caching.
  3843. */
  3844. type: "filesystem";
  3845. /**
  3846. * Version of the cache data. Different versions won't allow to reuse the cache and override existing content. Update the version when config changed in a way which doesn't allow to reuse cache. This will invalidate the cache.
  3847. */
  3848. version?: string;
  3849. }
  3850. declare interface FileSystem {
  3851. readFile: {
  3852. (arg0: string, arg1: FileSystemCallback<string | Buffer>): void;
  3853. (
  3854. arg0: string,
  3855. arg1: object,
  3856. arg2: FileSystemCallback<string | Buffer>
  3857. ): void;
  3858. };
  3859. readdir: {
  3860. (
  3861. arg0: string,
  3862. arg1: FileSystemCallback<(string | Buffer)[] | FileSystemDirent[]>
  3863. ): void;
  3864. (
  3865. arg0: string,
  3866. arg1: object,
  3867. arg2: FileSystemCallback<(string | Buffer)[] | FileSystemDirent[]>
  3868. ): void;
  3869. };
  3870. readJson?: {
  3871. (arg0: string, arg1: FileSystemCallback<object>): void;
  3872. (arg0: string, arg1: object, arg2: FileSystemCallback<object>): void;
  3873. };
  3874. readlink: {
  3875. (arg0: string, arg1: FileSystemCallback<string | Buffer>): void;
  3876. (
  3877. arg0: string,
  3878. arg1: object,
  3879. arg2: FileSystemCallback<string | Buffer>
  3880. ): void;
  3881. };
  3882. lstat?: {
  3883. (arg0: string, arg1: FileSystemCallback<FileSystemStats>): void;
  3884. (
  3885. arg0: string,
  3886. arg1: object,
  3887. arg2: FileSystemCallback<string | Buffer>
  3888. ): void;
  3889. };
  3890. stat: {
  3891. (arg0: string, arg1: FileSystemCallback<FileSystemStats>): void;
  3892. (
  3893. arg0: string,
  3894. arg1: object,
  3895. arg2: FileSystemCallback<string | Buffer>
  3896. ): void;
  3897. };
  3898. }
  3899. declare interface FileSystemCallback<T> {
  3900. (err?: null | (PossibleFileSystemError & Error), result?: T): any;
  3901. }
  3902. declare interface FileSystemDirent {
  3903. name: string | Buffer;
  3904. isDirectory: () => boolean;
  3905. isFile: () => boolean;
  3906. }
  3907. declare abstract class FileSystemInfo {
  3908. fs: InputFileSystem;
  3909. logger?: WebpackLogger;
  3910. fileTimestampQueue: AsyncQueue<string, string, null | FileSystemInfoEntry>;
  3911. fileHashQueue: AsyncQueue<string, string, null | string>;
  3912. contextTimestampQueue: AsyncQueue<
  3913. string,
  3914. string,
  3915. null | ContextFileSystemInfoEntry
  3916. >;
  3917. contextHashQueue: AsyncQueue<string, string, null | ContextHash>;
  3918. contextTshQueue: AsyncQueue<string, string, null | ContextTimestampAndHash>;
  3919. managedItemQueue: AsyncQueue<string, string, null | string>;
  3920. managedItemDirectoryQueue: AsyncQueue<string, string, Set<string>>;
  3921. managedPaths: (string | RegExp)[];
  3922. managedPathsWithSlash: string[];
  3923. managedPathsRegExps: RegExp[];
  3924. immutablePaths: (string | RegExp)[];
  3925. immutablePathsWithSlash: string[];
  3926. immutablePathsRegExps: RegExp[];
  3927. logStatistics(): void;
  3928. clear(): void;
  3929. addFileTimestamps(
  3930. map: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">,
  3931. immutable?: boolean
  3932. ): void;
  3933. addContextTimestamps(
  3934. map: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">,
  3935. immutable?: boolean
  3936. ): void;
  3937. getFileTimestamp(
  3938. path: string,
  3939. callback: (
  3940. arg0?: null | WebpackError,
  3941. arg1?: null | FileSystemInfoEntry | "ignore"
  3942. ) => void
  3943. ): void;
  3944. getContextTimestamp(
  3945. path: string,
  3946. callback: (
  3947. arg0?: null | WebpackError,
  3948. arg1?: null | "ignore" | ResolvedContextFileSystemInfoEntry
  3949. ) => void
  3950. ): void;
  3951. getFileHash(
  3952. path: string,
  3953. callback: (arg0?: null | WebpackError, arg1?: string) => void
  3954. ): void;
  3955. getContextHash(
  3956. path: string,
  3957. callback: (arg0?: null | WebpackError, arg1?: string) => void
  3958. ): void;
  3959. getContextTsh(
  3960. path: string,
  3961. callback: (
  3962. arg0?: null | WebpackError,
  3963. arg1?: ResolvedContextTimestampAndHash
  3964. ) => void
  3965. ): void;
  3966. resolveBuildDependencies(
  3967. context: string,
  3968. deps: Iterable<string>,
  3969. callback: (
  3970. arg0?: null | Error,
  3971. arg1?: ResolveBuildDependenciesResult
  3972. ) => void
  3973. ): void;
  3974. checkResolveResultsValid(
  3975. resolveResults: Map<string, string | false>,
  3976. callback: (arg0?: null | Error, arg1?: boolean) => void
  3977. ): void;
  3978. createSnapshot(
  3979. startTime: number,
  3980. files: Iterable<string>,
  3981. directories: Iterable<string>,
  3982. missing: Iterable<string>,
  3983. options: {
  3984. /**
  3985. * Use hashes of the content of the files/directories to determine invalidation.
  3986. */
  3987. hash?: boolean;
  3988. /**
  3989. * Use timestamps of the files/directories to determine invalidation.
  3990. */
  3991. timestamp?: boolean;
  3992. },
  3993. callback: (arg0?: null | WebpackError, arg1?: null | Snapshot) => void
  3994. ): void;
  3995. mergeSnapshots(snapshot1: Snapshot, snapshot2: Snapshot): Snapshot;
  3996. checkSnapshotValid(
  3997. snapshot: Snapshot,
  3998. callback: (arg0?: null | WebpackError, arg1?: boolean) => void
  3999. ): void;
  4000. getDeprecatedFileTimestamps(): Map<any, any>;
  4001. getDeprecatedContextTimestamps(): Map<any, any>;
  4002. }
  4003. declare interface FileSystemInfoEntry {
  4004. safeTime: number;
  4005. timestamp?: number;
  4006. }
  4007. declare interface FileSystemStats {
  4008. isDirectory: () => boolean;
  4009. isFile: () => boolean;
  4010. }
  4011. type FilterItemTypes = string | RegExp | ((value: string) => boolean);
  4012. declare interface GenerateContext {
  4013. /**
  4014. * mapping from dependencies to templates
  4015. */
  4016. dependencyTemplates: DependencyTemplates;
  4017. /**
  4018. * the runtime template
  4019. */
  4020. runtimeTemplate: RuntimeTemplate;
  4021. /**
  4022. * the module graph
  4023. */
  4024. moduleGraph: ModuleGraph;
  4025. /**
  4026. * the chunk graph
  4027. */
  4028. chunkGraph: ChunkGraph;
  4029. /**
  4030. * the requirements for runtime
  4031. */
  4032. runtimeRequirements: Set<string>;
  4033. /**
  4034. * the runtime
  4035. */
  4036. runtime: RuntimeSpec;
  4037. /**
  4038. * when in concatenated module, information about other concatenated modules
  4039. */
  4040. concatenationScope?: ConcatenationScope;
  4041. /**
  4042. * code generation results of other modules (need to have a codeGenerationDependency to use that)
  4043. */
  4044. codeGenerationResults?: CodeGenerationResults;
  4045. /**
  4046. * which kind of code should be generated
  4047. */
  4048. type: string;
  4049. /**
  4050. * get access to the code generation data
  4051. */
  4052. getData?: () => Map<string, any>;
  4053. }
  4054. declare class Generator {
  4055. constructor();
  4056. getTypes(module: NormalModule): Set<string>;
  4057. getSize(module: NormalModule, type?: string): number;
  4058. generate(module: NormalModule, __1: GenerateContext): Source;
  4059. getConcatenationBailoutReason(
  4060. module: NormalModule,
  4061. context: ConcatenationBailoutReasonContext
  4062. ): undefined | string;
  4063. updateHash(hash: Hash, __1: UpdateHashContextGenerator): void;
  4064. static byType(map?: any): ByTypeGenerator;
  4065. }
  4066. type GeneratorOptionsByModuleType = GeneratorOptionsByModuleTypeKnown &
  4067. GeneratorOptionsByModuleTypeUnknown;
  4068. /**
  4069. * Specify options for each generator.
  4070. */
  4071. declare interface GeneratorOptionsByModuleTypeKnown {
  4072. /**
  4073. * Generator options for asset modules.
  4074. */
  4075. asset?: AssetGeneratorOptions;
  4076. /**
  4077. * Generator options for asset/inline modules.
  4078. */
  4079. "asset/inline"?: AssetInlineGeneratorOptions;
  4080. /**
  4081. * Generator options for asset/resource modules.
  4082. */
  4083. "asset/resource"?: AssetResourceGeneratorOptions;
  4084. /**
  4085. * No generator options are supported for this module type.
  4086. */
  4087. javascript?: EmptyGeneratorOptions;
  4088. /**
  4089. * No generator options are supported for this module type.
  4090. */
  4091. "javascript/auto"?: EmptyGeneratorOptions;
  4092. /**
  4093. * No generator options are supported for this module type.
  4094. */
  4095. "javascript/dynamic"?: EmptyGeneratorOptions;
  4096. /**
  4097. * No generator options are supported for this module type.
  4098. */
  4099. "javascript/esm"?: EmptyGeneratorOptions;
  4100. }
  4101. /**
  4102. * Specify options for each generator.
  4103. */
  4104. declare interface GeneratorOptionsByModuleTypeUnknown {
  4105. [index: string]: { [index: string]: any };
  4106. }
  4107. declare class GetChunkFilenameRuntimeModule extends RuntimeModule {
  4108. constructor(
  4109. contentType: string,
  4110. name: string,
  4111. global: string,
  4112. getFilenameForChunk: (
  4113. arg0: Chunk
  4114. ) => string | ((arg0: PathData, arg1?: AssetInfo) => string),
  4115. allChunks: boolean
  4116. );
  4117. contentType: string;
  4118. global: string;
  4119. getFilenameForChunk: (
  4120. arg0: Chunk
  4121. ) => string | ((arg0: PathData, arg1?: AssetInfo) => string);
  4122. allChunks: boolean;
  4123. /**
  4124. * Runtime modules without any dependencies to other runtime modules
  4125. */
  4126. static STAGE_NORMAL: number;
  4127. /**
  4128. * Runtime modules with simple dependencies on other runtime modules
  4129. */
  4130. static STAGE_BASIC: number;
  4131. /**
  4132. * Runtime modules which attach to handlers of other runtime modules
  4133. */
  4134. static STAGE_ATTACH: number;
  4135. /**
  4136. * Runtime modules which trigger actions on bootstrap
  4137. */
  4138. static STAGE_TRIGGER: number;
  4139. }
  4140. declare interface GroupConfig {
  4141. getKeys: (arg0?: any) => string[];
  4142. createGroup: (arg0: string, arg1: any[], arg2: any[]) => object;
  4143. getOptions?: (arg0: string, arg1: any[]) => GroupOptions;
  4144. }
  4145. declare interface GroupOptions {
  4146. groupChildren?: boolean;
  4147. force?: boolean;
  4148. targetGroupCount?: number;
  4149. }
  4150. declare interface HMRJavascriptParserHooks {
  4151. hotAcceptCallback: SyncBailHook<[any, string[]], void>;
  4152. hotAcceptWithoutCallback: SyncBailHook<[any, string[]], void>;
  4153. }
  4154. declare interface HandleModuleCreationOptions {
  4155. factory: ModuleFactory;
  4156. dependencies: Dependency[];
  4157. originModule: null | Module;
  4158. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  4159. context?: string;
  4160. /**
  4161. * recurse into dependencies of the created module
  4162. */
  4163. recursive?: boolean;
  4164. /**
  4165. * connect the resolved module with the origin module
  4166. */
  4167. connectOrigin?: boolean;
  4168. }
  4169. declare class Hash {
  4170. constructor();
  4171. /**
  4172. * Update hash {@link https ://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
  4173. */
  4174. update(data: string | Buffer, inputEncoding?: string): Hash;
  4175. /**
  4176. * Calculates the digest {@link https ://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
  4177. */
  4178. digest(encoding?: string): string | Buffer;
  4179. }
  4180. declare interface HashableObject {
  4181. updateHash: (arg0: Hash) => void;
  4182. }
  4183. declare class HashedModuleIdsPlugin {
  4184. constructor(options?: HashedModuleIdsPluginOptions);
  4185. options: HashedModuleIdsPluginOptions;
  4186. apply(compiler?: any): void;
  4187. }
  4188. declare interface HashedModuleIdsPluginOptions {
  4189. /**
  4190. * The context directory for creating names.
  4191. */
  4192. context?: string;
  4193. /**
  4194. * The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported.
  4195. */
  4196. hashDigest?: "latin1" | "hex" | "base64";
  4197. /**
  4198. * The prefix length of the hash digest to use, defaults to 4.
  4199. */
  4200. hashDigestLength?: number;
  4201. /**
  4202. * The hashing algorithm to use, defaults to 'md4'. All functions from Node.JS' crypto.createHash are supported.
  4203. */
  4204. hashFunction?: string | typeof Hash;
  4205. }
  4206. declare abstract class HelperRuntimeModule extends RuntimeModule {}
  4207. declare class HotModuleReplacementPlugin {
  4208. constructor(options?: any);
  4209. options: any;
  4210. /**
  4211. * Apply the plugin
  4212. */
  4213. apply(compiler: Compiler): void;
  4214. static getParserHooks(parser: JavascriptParser): HMRJavascriptParserHooks;
  4215. }
  4216. /**
  4217. * These properties are added by the HotModuleReplacementPlugin
  4218. */
  4219. declare interface HotModuleReplacementPluginLoaderContext {
  4220. hot?: boolean;
  4221. }
  4222. declare class HotUpdateChunk extends Chunk {
  4223. constructor();
  4224. }
  4225. /**
  4226. * Options for building http resources.
  4227. */
  4228. declare interface HttpUriOptions {
  4229. /**
  4230. * List of allowed URIs (resp. the beginning of them).
  4231. */
  4232. allowedUris: (string | RegExp | ((uri: string) => boolean))[];
  4233. /**
  4234. * Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false.
  4235. */
  4236. cacheLocation?: string | false;
  4237. /**
  4238. * When set, anything that would lead to a modification of the lockfile or any resource content, will result in an error.
  4239. */
  4240. frozen?: boolean;
  4241. /**
  4242. * Location of the lockfile.
  4243. */
  4244. lockfileLocation?: string;
  4245. /**
  4246. * Proxy configuration, which can be used to specify a proxy server to use for HTTP requests.
  4247. */
  4248. proxy?: string;
  4249. /**
  4250. * When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.
  4251. */
  4252. upgrade?: boolean;
  4253. }
  4254. declare class HttpUriPlugin {
  4255. constructor(options: HttpUriOptions);
  4256. /**
  4257. * Apply the plugin
  4258. */
  4259. apply(compiler: Compiler): void;
  4260. }
  4261. declare interface IDirent {
  4262. isFile: () => boolean;
  4263. isDirectory: () => boolean;
  4264. isBlockDevice: () => boolean;
  4265. isCharacterDevice: () => boolean;
  4266. isSymbolicLink: () => boolean;
  4267. isFIFO: () => boolean;
  4268. isSocket: () => boolean;
  4269. name: string | Buffer;
  4270. }
  4271. declare interface IStats {
  4272. isFile: () => boolean;
  4273. isDirectory: () => boolean;
  4274. isBlockDevice: () => boolean;
  4275. isCharacterDevice: () => boolean;
  4276. isSymbolicLink: () => boolean;
  4277. isFIFO: () => boolean;
  4278. isSocket: () => boolean;
  4279. dev: number | bigint;
  4280. ino: number | bigint;
  4281. mode: number | bigint;
  4282. nlink: number | bigint;
  4283. uid: number | bigint;
  4284. gid: number | bigint;
  4285. rdev: number | bigint;
  4286. size: number | bigint;
  4287. blksize: number | bigint;
  4288. blocks: number | bigint;
  4289. atimeMs: number | bigint;
  4290. mtimeMs: number | bigint;
  4291. ctimeMs: number | bigint;
  4292. birthtimeMs: number | bigint;
  4293. atime: Date;
  4294. mtime: Date;
  4295. ctime: Date;
  4296. birthtime: Date;
  4297. }
  4298. declare class IgnorePlugin {
  4299. constructor(options: IgnorePluginOptions);
  4300. options: IgnorePluginOptions;
  4301. /**
  4302. * Note that if "contextRegExp" is given, both the "resourceRegExp"
  4303. * and "contextRegExp" have to match.
  4304. */
  4305. checkIgnore(resolveData: ResolveData): undefined | false;
  4306. /**
  4307. * Apply the plugin
  4308. */
  4309. apply(compiler: Compiler): void;
  4310. }
  4311. type IgnorePluginOptions =
  4312. | {
  4313. /**
  4314. * A RegExp to test the context (directory) against.
  4315. */
  4316. contextRegExp?: RegExp;
  4317. /**
  4318. * A RegExp to test the request against.
  4319. */
  4320. resourceRegExp: RegExp;
  4321. }
  4322. | {
  4323. /**
  4324. * A filter function for resource and context.
  4325. */
  4326. checkResource: (resource: string, context: string) => boolean;
  4327. };
  4328. declare interface ImportModuleOptions {
  4329. /**
  4330. * the target layer
  4331. */
  4332. layer?: string;
  4333. /**
  4334. * the target public path
  4335. */
  4336. publicPath?: string;
  4337. /**
  4338. * target base uri
  4339. */
  4340. baseUri?: string;
  4341. }
  4342. type ImportSource =
  4343. | undefined
  4344. | null
  4345. | string
  4346. | SimpleLiteral
  4347. | RegExpLiteral
  4348. | BigIntLiteral;
  4349. /**
  4350. * Options for infrastructure level logging.
  4351. */
  4352. declare interface InfrastructureLogging {
  4353. /**
  4354. * Only appends lines to the output. Avoids updating existing output e. g. for status messages. This option is only used when no custom console is provided.
  4355. */
  4356. appendOnly?: boolean;
  4357. /**
  4358. * Enables/Disables colorful output. This option is only used when no custom console is provided.
  4359. */
  4360. colors?: boolean;
  4361. /**
  4362. * Custom console used for logging.
  4363. */
  4364. console?: Console;
  4365. /**
  4366. * Enable debug logging for specific loggers.
  4367. */
  4368. debug?:
  4369. | string
  4370. | boolean
  4371. | RegExp
  4372. | FilterItemTypes[]
  4373. | ((value: string) => boolean);
  4374. /**
  4375. * Log level.
  4376. */
  4377. level?: "none" | "error" | "warn" | "info" | "log" | "verbose";
  4378. /**
  4379. * Stream used for logging output. Defaults to process.stderr. This option is only used when no custom console is provided.
  4380. */
  4381. stream?: NodeJS.WritableStream;
  4382. }
  4383. declare abstract class InitFragment<Context> {
  4384. content: string | Source;
  4385. stage: number;
  4386. position: number;
  4387. key?: string;
  4388. endContent?: string | Source;
  4389. getContent(context: Context): string | Source;
  4390. getEndContent(context: Context): undefined | string | Source;
  4391. serialize(context?: any): void;
  4392. deserialize(context?: any): void;
  4393. merge: any;
  4394. }
  4395. declare interface InputFileSystem {
  4396. readFile: (
  4397. arg0: string,
  4398. arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: string | Buffer) => void
  4399. ) => void;
  4400. readJson?: (
  4401. arg0: string,
  4402. arg1: (arg0?: null | Error | NodeJS.ErrnoException, arg1?: any) => void
  4403. ) => void;
  4404. readlink: (
  4405. arg0: string,
  4406. arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: string | Buffer) => void
  4407. ) => void;
  4408. readdir: (
  4409. arg0: string,
  4410. arg1: (
  4411. arg0?: null | NodeJS.ErrnoException,
  4412. arg1?: (string | Buffer)[] | IDirent[]
  4413. ) => void
  4414. ) => void;
  4415. stat: (
  4416. arg0: string,
  4417. arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: IStats) => void
  4418. ) => void;
  4419. lstat?: (
  4420. arg0: string,
  4421. arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: IStats) => void
  4422. ) => void;
  4423. realpath?: (
  4424. arg0: string,
  4425. arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: string | Buffer) => void
  4426. ) => void;
  4427. purge?: (arg0?: string) => void;
  4428. join?: (arg0: string, arg1: string) => string;
  4429. relative?: (arg0: string, arg1: string) => string;
  4430. dirname?: (arg0: string) => string;
  4431. }
  4432. type IntermediateFileSystem = InputFileSystem &
  4433. OutputFileSystem &
  4434. IntermediateFileSystemExtras;
  4435. declare interface IntermediateFileSystemExtras {
  4436. mkdirSync: (arg0: string) => void;
  4437. createWriteStream: (arg0: string) => NodeJS.WritableStream;
  4438. open: (
  4439. arg0: string,
  4440. arg1: string,
  4441. arg2: (arg0?: null | NodeJS.ErrnoException, arg1?: number) => void
  4442. ) => void;
  4443. read: (
  4444. arg0: number,
  4445. arg1: Buffer,
  4446. arg2: number,
  4447. arg3: number,
  4448. arg4: number,
  4449. arg5: (arg0?: null | NodeJS.ErrnoException, arg1?: number) => void
  4450. ) => void;
  4451. close: (
  4452. arg0: number,
  4453. arg1: (arg0?: null | NodeJS.ErrnoException) => void
  4454. ) => void;
  4455. rename: (
  4456. arg0: string,
  4457. arg1: string,
  4458. arg2: (arg0?: null | NodeJS.ErrnoException) => void
  4459. ) => void;
  4460. }
  4461. type InternalCell<T> = T | typeof TOMBSTONE | typeof UNDEFINED_MARKER;
  4462. declare abstract class ItemCacheFacade {
  4463. get<T>(callback: CallbackCache<T>): void;
  4464. getPromise<T>(): Promise<T>;
  4465. store<T>(data: T, callback: CallbackCache<void>): void;
  4466. storePromise<T>(data: T): Promise<void>;
  4467. provide<T>(
  4468. computer: (arg0: CallbackNormalErrorCache<T>) => void,
  4469. callback: CallbackNormalErrorCache<T>
  4470. ): void;
  4471. providePromise<T>(computer: () => T | Promise<T>): Promise<T>;
  4472. }
  4473. declare class JavascriptModulesPlugin {
  4474. constructor(options?: object);
  4475. options: object;
  4476. /**
  4477. * Apply the plugin
  4478. */
  4479. apply(compiler: Compiler): void;
  4480. renderModule(
  4481. module: Module,
  4482. renderContext: ChunkRenderContext,
  4483. hooks: CompilationHooksJavascriptModulesPlugin,
  4484. factory: boolean
  4485. ): Source;
  4486. renderChunk(
  4487. renderContext: RenderContext,
  4488. hooks: CompilationHooksJavascriptModulesPlugin
  4489. ): Source;
  4490. renderMain(
  4491. renderContext: MainRenderContext,
  4492. hooks: CompilationHooksJavascriptModulesPlugin,
  4493. compilation: Compilation
  4494. ): Source;
  4495. updateHashWithBootstrap(
  4496. hash: Hash,
  4497. renderContext: RenderBootstrapContext,
  4498. hooks: CompilationHooksJavascriptModulesPlugin
  4499. ): void;
  4500. renderBootstrap(
  4501. renderContext: RenderBootstrapContext,
  4502. hooks: CompilationHooksJavascriptModulesPlugin
  4503. ): {
  4504. header: string[];
  4505. beforeStartup: string[];
  4506. startup: string[];
  4507. afterStartup: string[];
  4508. allowInlineStartup: boolean;
  4509. };
  4510. renderRequire(
  4511. renderContext: RenderBootstrapContext,
  4512. hooks: CompilationHooksJavascriptModulesPlugin
  4513. ): string;
  4514. static getCompilationHooks(
  4515. compilation: Compilation
  4516. ): CompilationHooksJavascriptModulesPlugin;
  4517. static getChunkFilenameTemplate(chunk?: any, outputOptions?: any): any;
  4518. static chunkHasJs: (chunk: Chunk, chunkGraph: ChunkGraph) => boolean;
  4519. }
  4520. declare class JavascriptParser extends Parser {
  4521. constructor(sourceType?: "module" | "auto" | "script");
  4522. hooks: Readonly<{
  4523. evaluateTypeof: HookMap<
  4524. SyncBailHook<
  4525. [UnaryExpression],
  4526. undefined | null | BasicEvaluatedExpression
  4527. >
  4528. >;
  4529. evaluate: HookMap<
  4530. SyncBailHook<[Expression], undefined | null | BasicEvaluatedExpression>
  4531. >;
  4532. evaluateIdentifier: HookMap<
  4533. SyncBailHook<
  4534. [ThisExpression | MemberExpression | MetaProperty | Identifier],
  4535. undefined | null | BasicEvaluatedExpression
  4536. >
  4537. >;
  4538. evaluateDefinedIdentifier: HookMap<
  4539. SyncBailHook<
  4540. [ThisExpression | MemberExpression | Identifier],
  4541. undefined | null | BasicEvaluatedExpression
  4542. >
  4543. >;
  4544. evaluateCallExpressionMember: HookMap<
  4545. SyncBailHook<
  4546. [CallExpression, undefined | BasicEvaluatedExpression],
  4547. undefined | null | BasicEvaluatedExpression
  4548. >
  4549. >;
  4550. isPure: HookMap<
  4551. SyncBailHook<
  4552. [
  4553. (
  4554. | UnaryExpression
  4555. | ThisExpression
  4556. | ArrayExpression
  4557. | ObjectExpression
  4558. | FunctionExpression
  4559. | ArrowFunctionExpression
  4560. | YieldExpression
  4561. | SimpleLiteral
  4562. | RegExpLiteral
  4563. | BigIntLiteral
  4564. | UpdateExpression
  4565. | BinaryExpression
  4566. | AssignmentExpression
  4567. | LogicalExpression
  4568. | MemberExpression
  4569. | ConditionalExpression
  4570. | SimpleCallExpression
  4571. | NewExpression
  4572. | SequenceExpression
  4573. | TemplateLiteral
  4574. | TaggedTemplateExpression
  4575. | ClassExpression
  4576. | MetaProperty
  4577. | Identifier
  4578. | AwaitExpression
  4579. | ImportExpression
  4580. | ChainExpression
  4581. | FunctionDeclaration
  4582. | VariableDeclaration
  4583. | ClassDeclaration
  4584. | PrivateIdentifier
  4585. ),
  4586. number
  4587. ],
  4588. boolean | void
  4589. >
  4590. >;
  4591. preStatement: SyncBailHook<
  4592. [
  4593. | FunctionDeclaration
  4594. | VariableDeclaration
  4595. | ClassDeclaration
  4596. | ExpressionStatement
  4597. | BlockStatement
  4598. | StaticBlock
  4599. | EmptyStatement
  4600. | DebuggerStatement
  4601. | WithStatement
  4602. | ReturnStatement
  4603. | LabeledStatement
  4604. | BreakStatement
  4605. | ContinueStatement
  4606. | IfStatement
  4607. | SwitchStatement
  4608. | ThrowStatement
  4609. | TryStatement
  4610. | WhileStatement
  4611. | DoWhileStatement
  4612. | ForStatement
  4613. | ForInStatement
  4614. | ForOfStatement
  4615. | ImportDeclaration
  4616. | ExportNamedDeclaration
  4617. | ExportDefaultDeclaration
  4618. | ExportAllDeclaration
  4619. ],
  4620. boolean | void
  4621. >;
  4622. blockPreStatement: SyncBailHook<
  4623. [
  4624. | FunctionDeclaration
  4625. | VariableDeclaration
  4626. | ClassDeclaration
  4627. | ExpressionStatement
  4628. | BlockStatement
  4629. | StaticBlock
  4630. | EmptyStatement
  4631. | DebuggerStatement
  4632. | WithStatement
  4633. | ReturnStatement
  4634. | LabeledStatement
  4635. | BreakStatement
  4636. | ContinueStatement
  4637. | IfStatement
  4638. | SwitchStatement
  4639. | ThrowStatement
  4640. | TryStatement
  4641. | WhileStatement
  4642. | DoWhileStatement
  4643. | ForStatement
  4644. | ForInStatement
  4645. | ForOfStatement
  4646. | ImportDeclaration
  4647. | ExportNamedDeclaration
  4648. | ExportDefaultDeclaration
  4649. | ExportAllDeclaration
  4650. ],
  4651. boolean | void
  4652. >;
  4653. statement: SyncBailHook<
  4654. [
  4655. | FunctionDeclaration
  4656. | VariableDeclaration
  4657. | ClassDeclaration
  4658. | ExpressionStatement
  4659. | BlockStatement
  4660. | StaticBlock
  4661. | EmptyStatement
  4662. | DebuggerStatement
  4663. | WithStatement
  4664. | ReturnStatement
  4665. | LabeledStatement
  4666. | BreakStatement
  4667. | ContinueStatement
  4668. | IfStatement
  4669. | SwitchStatement
  4670. | ThrowStatement
  4671. | TryStatement
  4672. | WhileStatement
  4673. | DoWhileStatement
  4674. | ForStatement
  4675. | ForInStatement
  4676. | ForOfStatement
  4677. | ImportDeclaration
  4678. | ExportNamedDeclaration
  4679. | ExportDefaultDeclaration
  4680. | ExportAllDeclaration
  4681. ],
  4682. boolean | void
  4683. >;
  4684. statementIf: SyncBailHook<[IfStatement], boolean | void>;
  4685. classExtendsExpression: SyncBailHook<
  4686. [Expression, ClassExpression | ClassDeclaration],
  4687. boolean | void
  4688. >;
  4689. classBodyElement: SyncBailHook<
  4690. [
  4691. MethodDefinition | PropertyDefinition,
  4692. ClassExpression | ClassDeclaration
  4693. ],
  4694. boolean | void
  4695. >;
  4696. classBodyValue: SyncBailHook<
  4697. [
  4698. Expression,
  4699. MethodDefinition | PropertyDefinition,
  4700. ClassExpression | ClassDeclaration
  4701. ],
  4702. boolean | void
  4703. >;
  4704. label: HookMap<SyncBailHook<[LabeledStatement], boolean | void>>;
  4705. import: SyncBailHook<[ImportDeclaration, ImportSource], boolean | void>;
  4706. importSpecifier: SyncBailHook<
  4707. [ImportDeclaration, ImportSource, string, string],
  4708. boolean | void
  4709. >;
  4710. export: SyncBailHook<
  4711. [ExportNamedDeclaration | ExportAllDeclaration],
  4712. boolean | void
  4713. >;
  4714. exportImport: SyncBailHook<
  4715. [ExportNamedDeclaration | ExportAllDeclaration, ImportSource],
  4716. boolean | void
  4717. >;
  4718. exportDeclaration: SyncBailHook<
  4719. [ExportNamedDeclaration | ExportAllDeclaration, Declaration],
  4720. boolean | void
  4721. >;
  4722. exportExpression: SyncBailHook<
  4723. [ExportDefaultDeclaration, Declaration],
  4724. boolean | void
  4725. >;
  4726. exportSpecifier: SyncBailHook<
  4727. [
  4728. ExportNamedDeclaration | ExportAllDeclaration,
  4729. string,
  4730. string,
  4731. undefined | number
  4732. ],
  4733. boolean | void
  4734. >;
  4735. exportImportSpecifier: SyncBailHook<
  4736. [
  4737. ExportNamedDeclaration | ExportAllDeclaration,
  4738. ImportSource,
  4739. string,
  4740. string,
  4741. undefined | number
  4742. ],
  4743. boolean | void
  4744. >;
  4745. preDeclarator: SyncBailHook<
  4746. [VariableDeclarator, Statement],
  4747. boolean | void
  4748. >;
  4749. declarator: SyncBailHook<[VariableDeclarator, Statement], boolean | void>;
  4750. varDeclaration: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  4751. varDeclarationLet: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  4752. varDeclarationConst: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  4753. varDeclarationVar: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  4754. pattern: HookMap<SyncBailHook<[Identifier], boolean | void>>;
  4755. canRename: HookMap<SyncBailHook<[Expression], boolean | void>>;
  4756. rename: HookMap<SyncBailHook<[Expression], boolean | void>>;
  4757. assign: HookMap<SyncBailHook<[AssignmentExpression], boolean | void>>;
  4758. assignMemberChain: HookMap<
  4759. SyncBailHook<[AssignmentExpression, string[]], boolean | void>
  4760. >;
  4761. typeof: HookMap<SyncBailHook<[Expression], boolean | void>>;
  4762. importCall: SyncBailHook<[Expression], boolean | void>;
  4763. topLevelAwait: SyncBailHook<[Expression], boolean | void>;
  4764. call: HookMap<SyncBailHook<[Expression], boolean | void>>;
  4765. callMemberChain: HookMap<
  4766. SyncBailHook<[CallExpression, string[], boolean[]], boolean | void>
  4767. >;
  4768. memberChainOfCallMemberChain: HookMap<
  4769. SyncBailHook<
  4770. [Expression, string[], CallExpression, string[]],
  4771. boolean | void
  4772. >
  4773. >;
  4774. callMemberChainOfCallMemberChain: HookMap<
  4775. SyncBailHook<
  4776. [Expression, string[], CallExpression, string[]],
  4777. boolean | void
  4778. >
  4779. >;
  4780. optionalChaining: SyncBailHook<[ChainExpression], boolean | void>;
  4781. new: HookMap<SyncBailHook<[NewExpression], boolean | void>>;
  4782. binaryExpression: SyncBailHook<[BinaryExpression], boolean | void>;
  4783. expression: HookMap<SyncBailHook<[Expression], boolean | void>>;
  4784. expressionMemberChain: HookMap<
  4785. SyncBailHook<[Expression, string[], boolean[]], boolean | void>
  4786. >;
  4787. unhandledExpressionMemberChain: HookMap<
  4788. SyncBailHook<[Expression, string[]], boolean | void>
  4789. >;
  4790. expressionConditionalOperator: SyncBailHook<[Expression], boolean | void>;
  4791. expressionLogicalOperator: SyncBailHook<[Expression], boolean | void>;
  4792. program: SyncBailHook<[Program, Comment[]], boolean | void>;
  4793. finish: SyncBailHook<[Program, Comment[]], boolean | void>;
  4794. }>;
  4795. sourceType: "module" | "auto" | "script";
  4796. scope: ScopeInfo;
  4797. state: ParserState;
  4798. comments: any;
  4799. semicolons: any;
  4800. statementPath: (
  4801. | UnaryExpression
  4802. | ThisExpression
  4803. | ArrayExpression
  4804. | ObjectExpression
  4805. | FunctionExpression
  4806. | ArrowFunctionExpression
  4807. | YieldExpression
  4808. | SimpleLiteral
  4809. | RegExpLiteral
  4810. | BigIntLiteral
  4811. | UpdateExpression
  4812. | BinaryExpression
  4813. | AssignmentExpression
  4814. | LogicalExpression
  4815. | MemberExpression
  4816. | ConditionalExpression
  4817. | SimpleCallExpression
  4818. | NewExpression
  4819. | SequenceExpression
  4820. | TemplateLiteral
  4821. | TaggedTemplateExpression
  4822. | ClassExpression
  4823. | MetaProperty
  4824. | Identifier
  4825. | AwaitExpression
  4826. | ImportExpression
  4827. | ChainExpression
  4828. | FunctionDeclaration
  4829. | VariableDeclaration
  4830. | ClassDeclaration
  4831. | ExpressionStatement
  4832. | BlockStatement
  4833. | StaticBlock
  4834. | EmptyStatement
  4835. | DebuggerStatement
  4836. | WithStatement
  4837. | ReturnStatement
  4838. | LabeledStatement
  4839. | BreakStatement
  4840. | ContinueStatement
  4841. | IfStatement
  4842. | SwitchStatement
  4843. | ThrowStatement
  4844. | TryStatement
  4845. | WhileStatement
  4846. | DoWhileStatement
  4847. | ForStatement
  4848. | ForInStatement
  4849. | ForOfStatement
  4850. )[];
  4851. prevStatement: any;
  4852. currentTagData: any;
  4853. getRenameIdentifier(expr?: any): undefined | string | VariableInfoInterface;
  4854. walkClass(classy: ClassExpression | ClassDeclaration): void;
  4855. preWalkStatements(statements?: any): void;
  4856. blockPreWalkStatements(statements?: any): void;
  4857. walkStatements(statements?: any): void;
  4858. preWalkStatement(statement?: any): void;
  4859. blockPreWalkStatement(statement?: any): void;
  4860. walkStatement(statement?: any): void;
  4861. /**
  4862. * Walks a statements that is nested within a parent statement
  4863. * and can potentially be a non-block statement.
  4864. * This enforces the nested statement to never be in ASI position.
  4865. */
  4866. walkNestedStatement(statement: Statement): void;
  4867. preWalkBlockStatement(statement?: any): void;
  4868. walkBlockStatement(statement?: any): void;
  4869. walkExpressionStatement(statement?: any): void;
  4870. preWalkIfStatement(statement?: any): void;
  4871. walkIfStatement(statement?: any): void;
  4872. preWalkLabeledStatement(statement?: any): void;
  4873. walkLabeledStatement(statement?: any): void;
  4874. preWalkWithStatement(statement?: any): void;
  4875. walkWithStatement(statement?: any): void;
  4876. preWalkSwitchStatement(statement?: any): void;
  4877. walkSwitchStatement(statement?: any): void;
  4878. walkTerminatingStatement(statement?: any): void;
  4879. walkReturnStatement(statement?: any): void;
  4880. walkThrowStatement(statement?: any): void;
  4881. preWalkTryStatement(statement?: any): void;
  4882. walkTryStatement(statement?: any): void;
  4883. preWalkWhileStatement(statement?: any): void;
  4884. walkWhileStatement(statement?: any): void;
  4885. preWalkDoWhileStatement(statement?: any): void;
  4886. walkDoWhileStatement(statement?: any): void;
  4887. preWalkForStatement(statement?: any): void;
  4888. walkForStatement(statement?: any): void;
  4889. preWalkForInStatement(statement?: any): void;
  4890. walkForInStatement(statement?: any): void;
  4891. preWalkForOfStatement(statement?: any): void;
  4892. walkForOfStatement(statement?: any): void;
  4893. preWalkFunctionDeclaration(statement?: any): void;
  4894. walkFunctionDeclaration(statement?: any): void;
  4895. blockPreWalkImportDeclaration(statement?: any): void;
  4896. enterDeclaration(declaration?: any, onIdent?: any): void;
  4897. blockPreWalkExportNamedDeclaration(statement?: any): void;
  4898. walkExportNamedDeclaration(statement?: any): void;
  4899. blockPreWalkExportDefaultDeclaration(statement?: any): void;
  4900. walkExportDefaultDeclaration(statement?: any): void;
  4901. blockPreWalkExportAllDeclaration(statement?: any): void;
  4902. preWalkVariableDeclaration(statement?: any): void;
  4903. blockPreWalkVariableDeclaration(statement?: any): void;
  4904. walkVariableDeclaration(statement?: any): void;
  4905. blockPreWalkClassDeclaration(statement?: any): void;
  4906. walkClassDeclaration(statement?: any): void;
  4907. preWalkSwitchCases(switchCases?: any): void;
  4908. walkSwitchCases(switchCases?: any): void;
  4909. preWalkCatchClause(catchClause?: any): void;
  4910. walkCatchClause(catchClause?: any): void;
  4911. walkPattern(pattern?: any): void;
  4912. walkAssignmentPattern(pattern?: any): void;
  4913. walkObjectPattern(pattern?: any): void;
  4914. walkArrayPattern(pattern?: any): void;
  4915. walkRestElement(pattern?: any): void;
  4916. walkExpressions(expressions?: any): void;
  4917. walkExpression(expression?: any): void;
  4918. walkAwaitExpression(expression?: any): void;
  4919. walkArrayExpression(expression?: any): void;
  4920. walkSpreadElement(expression?: any): void;
  4921. walkObjectExpression(expression?: any): void;
  4922. walkProperty(prop?: any): void;
  4923. walkFunctionExpression(expression?: any): void;
  4924. walkArrowFunctionExpression(expression?: any): void;
  4925. walkSequenceExpression(expression: SequenceExpression): void;
  4926. walkUpdateExpression(expression?: any): void;
  4927. walkUnaryExpression(expression?: any): void;
  4928. walkLeftRightExpression(expression?: any): void;
  4929. walkBinaryExpression(expression?: any): void;
  4930. walkLogicalExpression(expression?: any): void;
  4931. walkAssignmentExpression(expression?: any): void;
  4932. walkConditionalExpression(expression?: any): void;
  4933. walkNewExpression(expression?: any): void;
  4934. walkYieldExpression(expression?: any): void;
  4935. walkTemplateLiteral(expression?: any): void;
  4936. walkTaggedTemplateExpression(expression?: any): void;
  4937. walkClassExpression(expression?: any): void;
  4938. walkChainExpression(expression: ChainExpression): void;
  4939. walkImportExpression(expression?: any): void;
  4940. walkCallExpression(expression?: any): void;
  4941. walkMemberExpression(expression?: any): void;
  4942. walkMemberExpressionWithExpressionName(
  4943. expression?: any,
  4944. name?: any,
  4945. rootInfo?: any,
  4946. members?: any,
  4947. onUnhandled?: any
  4948. ): void;
  4949. walkThisExpression(expression?: any): void;
  4950. walkIdentifier(expression?: any): void;
  4951. walkMetaProperty(metaProperty: MetaProperty): void;
  4952. callHooksForExpression(hookMap: any, expr: any, ...args: any[]): any;
  4953. callHooksForExpressionWithFallback<T, R>(
  4954. hookMap: HookMap<SyncBailHook<T, R>>,
  4955. expr: MemberExpression,
  4956. fallback: (
  4957. arg0: string,
  4958. arg1: string | ScopeInfo | VariableInfo,
  4959. arg2: () => string[]
  4960. ) => any,
  4961. defined: (arg0: string) => any,
  4962. ...args: AsArray<T>
  4963. ): R;
  4964. callHooksForName<T, R>(
  4965. hookMap: HookMap<SyncBailHook<T, R>>,
  4966. name: string,
  4967. ...args: AsArray<T>
  4968. ): R;
  4969. callHooksForInfo<T, R>(
  4970. hookMap: HookMap<SyncBailHook<T, R>>,
  4971. info: ExportedVariableInfo,
  4972. ...args: AsArray<T>
  4973. ): R;
  4974. callHooksForInfoWithFallback<T, R>(
  4975. hookMap: HookMap<SyncBailHook<T, R>>,
  4976. info: ExportedVariableInfo,
  4977. fallback: (arg0: string) => any,
  4978. defined: () => any,
  4979. ...args: AsArray<T>
  4980. ): R;
  4981. callHooksForNameWithFallback<T, R>(
  4982. hookMap: HookMap<SyncBailHook<T, R>>,
  4983. name: string,
  4984. fallback: (arg0: string) => any,
  4985. defined: () => any,
  4986. ...args: AsArray<T>
  4987. ): R;
  4988. inScope(params: any, fn: () => void): void;
  4989. inFunctionScope(hasThis?: any, params?: any, fn?: any): void;
  4990. inBlockScope(fn?: any): void;
  4991. detectMode(statements?: any): void;
  4992. enterPatterns(patterns?: any, onIdent?: any): void;
  4993. enterPattern(pattern?: any, onIdent?: any): void;
  4994. enterIdentifier(pattern?: any, onIdent?: any): void;
  4995. enterObjectPattern(pattern?: any, onIdent?: any): void;
  4996. enterArrayPattern(pattern?: any, onIdent?: any): void;
  4997. enterRestElement(pattern?: any, onIdent?: any): void;
  4998. enterAssignmentPattern(pattern?: any, onIdent?: any): void;
  4999. evaluateExpression(expression: Expression): BasicEvaluatedExpression;
  5000. parseString(expression?: any): any;
  5001. parseCalculatedString(expression?: any): any;
  5002. evaluate(source: string): BasicEvaluatedExpression;
  5003. isPure(
  5004. expr:
  5005. | undefined
  5006. | null
  5007. | UnaryExpression
  5008. | ThisExpression
  5009. | ArrayExpression
  5010. | ObjectExpression
  5011. | FunctionExpression
  5012. | ArrowFunctionExpression
  5013. | YieldExpression
  5014. | SimpleLiteral
  5015. | RegExpLiteral
  5016. | BigIntLiteral
  5017. | UpdateExpression
  5018. | BinaryExpression
  5019. | AssignmentExpression
  5020. | LogicalExpression
  5021. | MemberExpression
  5022. | ConditionalExpression
  5023. | SimpleCallExpression
  5024. | NewExpression
  5025. | SequenceExpression
  5026. | TemplateLiteral
  5027. | TaggedTemplateExpression
  5028. | ClassExpression
  5029. | MetaProperty
  5030. | Identifier
  5031. | AwaitExpression
  5032. | ImportExpression
  5033. | ChainExpression
  5034. | FunctionDeclaration
  5035. | VariableDeclaration
  5036. | ClassDeclaration
  5037. | PrivateIdentifier,
  5038. commentsStartPos: number
  5039. ): boolean;
  5040. getComments(range?: any): any[];
  5041. isAsiPosition(pos: number): boolean;
  5042. unsetAsiPosition(pos: number): void;
  5043. isStatementLevelExpression(expr?: any): boolean;
  5044. getTagData(name?: any, tag?: any): any;
  5045. tagVariable(name?: any, tag?: any, data?: any): void;
  5046. defineVariable(name?: any): void;
  5047. undefineVariable(name?: any): void;
  5048. isVariableDefined(name?: any): boolean;
  5049. getVariableInfo(name: string): ExportedVariableInfo;
  5050. setVariable(name: string, variableInfo: ExportedVariableInfo): void;
  5051. parseCommentOptions(
  5052. range?: any
  5053. ): { options: null; errors: null } | { options: object; errors: unknown[] };
  5054. extractMemberExpressionChain(expression: MemberExpression): {
  5055. members: string[];
  5056. object:
  5057. | UnaryExpression
  5058. | ThisExpression
  5059. | ArrayExpression
  5060. | ObjectExpression
  5061. | FunctionExpression
  5062. | ArrowFunctionExpression
  5063. | YieldExpression
  5064. | SimpleLiteral
  5065. | RegExpLiteral
  5066. | BigIntLiteral
  5067. | UpdateExpression
  5068. | BinaryExpression
  5069. | AssignmentExpression
  5070. | LogicalExpression
  5071. | MemberExpression
  5072. | ConditionalExpression
  5073. | SimpleCallExpression
  5074. | NewExpression
  5075. | SequenceExpression
  5076. | TemplateLiteral
  5077. | TaggedTemplateExpression
  5078. | ClassExpression
  5079. | MetaProperty
  5080. | Identifier
  5081. | AwaitExpression
  5082. | ImportExpression
  5083. | ChainExpression
  5084. | Super;
  5085. membersOptionals: boolean[];
  5086. };
  5087. getFreeInfoFromVariable(varName: string): {
  5088. name: string;
  5089. info: string | VariableInfo;
  5090. };
  5091. getMemberExpressionInfo(
  5092. expression: MemberExpression,
  5093. allowedTypes: number
  5094. ): undefined | CallExpressionInfo | ExpressionExpressionInfo;
  5095. getNameForExpression(expression: MemberExpression): {
  5096. name: string;
  5097. rootInfo: ExportedVariableInfo;
  5098. getMembers: () => string[];
  5099. };
  5100. static ALLOWED_MEMBER_TYPES_ALL: 3;
  5101. static ALLOWED_MEMBER_TYPES_EXPRESSION: 2;
  5102. static ALLOWED_MEMBER_TYPES_CALL_EXPRESSION: 1;
  5103. }
  5104. /**
  5105. * Parser options for javascript modules.
  5106. */
  5107. declare interface JavascriptParserOptions {
  5108. [index: string]: any;
  5109. /**
  5110. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  5111. */
  5112. amd?: false | { [index: string]: any };
  5113. /**
  5114. * Enable/disable special handling for browserify bundles.
  5115. */
  5116. browserify?: boolean;
  5117. /**
  5118. * Enable/disable parsing of CommonJs syntax.
  5119. */
  5120. commonjs?: boolean;
  5121. /**
  5122. * Enable/disable parsing of magic comments in CommonJs syntax.
  5123. */
  5124. commonjsMagicComments?: boolean;
  5125. /**
  5126. * Specifies the behavior of invalid export names in "import ... from ..." and "export ... from ...".
  5127. */
  5128. exportsPresence?: false | "auto" | "error" | "warn";
  5129. /**
  5130. * Enable warnings for full dynamic dependencies.
  5131. */
  5132. exprContextCritical?: boolean;
  5133. /**
  5134. * Enable recursive directory lookup for full dynamic dependencies.
  5135. */
  5136. exprContextRecursive?: boolean;
  5137. /**
  5138. * Sets the default regular expression for full dynamic dependencies.
  5139. */
  5140. exprContextRegExp?: boolean | RegExp;
  5141. /**
  5142. * Set the default request for full dynamic dependencies.
  5143. */
  5144. exprContextRequest?: string;
  5145. /**
  5146. * Enable/disable parsing of EcmaScript Modules syntax.
  5147. */
  5148. harmony?: boolean;
  5149. /**
  5150. * Enable/disable parsing of import() syntax.
  5151. */
  5152. import?: boolean;
  5153. /**
  5154. * Specifies the behavior of invalid export names in "import ... from ...".
  5155. */
  5156. importExportsPresence?: false | "auto" | "error" | "warn";
  5157. /**
  5158. * Enable/disable evaluating import.meta.
  5159. */
  5160. importMeta?: boolean;
  5161. /**
  5162. * Enable/disable evaluating import.meta.webpackContext.
  5163. */
  5164. importMetaContext?: boolean;
  5165. /**
  5166. * Include polyfills or mocks for various node stuff.
  5167. */
  5168. node?: false | NodeOptions;
  5169. /**
  5170. * Specifies the behavior of invalid export names in "export ... from ...". This might be useful to disable during the migration from "export ... from ..." to "export type ... from ..." when reexporting types in TypeScript.
  5171. */
  5172. reexportExportsPresence?: false | "auto" | "error" | "warn";
  5173. /**
  5174. * Enable/disable parsing of require.context syntax.
  5175. */
  5176. requireContext?: boolean;
  5177. /**
  5178. * Enable/disable parsing of require.ensure syntax.
  5179. */
  5180. requireEnsure?: boolean;
  5181. /**
  5182. * Enable/disable parsing of require.include syntax.
  5183. */
  5184. requireInclude?: boolean;
  5185. /**
  5186. * Enable/disable parsing of require.js special syntax like require.config, requirejs.config, require.version and requirejs.onError.
  5187. */
  5188. requireJs?: boolean;
  5189. /**
  5190. * Deprecated in favor of "exportsPresence". Emit errors instead of warnings when imported names don't exist in imported module.
  5191. */
  5192. strictExportPresence?: boolean;
  5193. /**
  5194. * Handle the this context correctly according to the spec for namespace objects.
  5195. */
  5196. strictThisContextOnImports?: boolean;
  5197. /**
  5198. * Enable/disable parsing of System.js special syntax like System.import, System.get, System.set and System.register.
  5199. */
  5200. system?: boolean;
  5201. /**
  5202. * Enable warnings when using the require function in a not statically analyse-able way.
  5203. */
  5204. unknownContextCritical?: boolean;
  5205. /**
  5206. * Enable recursive directory lookup when using the require function in a not statically analyse-able way.
  5207. */
  5208. unknownContextRecursive?: boolean;
  5209. /**
  5210. * Sets the regular expression when using the require function in a not statically analyse-able way.
  5211. */
  5212. unknownContextRegExp?: boolean | RegExp;
  5213. /**
  5214. * Sets the request when using the require function in a not statically analyse-able way.
  5215. */
  5216. unknownContextRequest?: string;
  5217. /**
  5218. * Enable/disable parsing of new URL() syntax.
  5219. */
  5220. url?: boolean | "relative";
  5221. /**
  5222. * Disable or configure parsing of WebWorker syntax like new Worker() or navigator.serviceWorker.register().
  5223. */
  5224. worker?: boolean | string[];
  5225. /**
  5226. * Enable warnings for partial dynamic dependencies.
  5227. */
  5228. wrappedContextCritical?: boolean;
  5229. /**
  5230. * Enable recursive directory lookup for partial dynamic dependencies.
  5231. */
  5232. wrappedContextRecursive?: boolean;
  5233. /**
  5234. * Set the inner regular expression for partial dynamic dependencies.
  5235. */
  5236. wrappedContextRegExp?: RegExp;
  5237. }
  5238. declare class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
  5239. constructor(runtimeRequirements?: any);
  5240. static getCompilationHooks(
  5241. compilation: Compilation
  5242. ): JsonpCompilationPluginHooks;
  5243. /**
  5244. * Runtime modules without any dependencies to other runtime modules
  5245. */
  5246. static STAGE_NORMAL: number;
  5247. /**
  5248. * Runtime modules with simple dependencies on other runtime modules
  5249. */
  5250. static STAGE_BASIC: number;
  5251. /**
  5252. * Runtime modules which attach to handlers of other runtime modules
  5253. */
  5254. static STAGE_ATTACH: number;
  5255. /**
  5256. * Runtime modules which trigger actions on bootstrap
  5257. */
  5258. static STAGE_TRIGGER: number;
  5259. }
  5260. declare interface JsonpCompilationPluginHooks {
  5261. linkPreload: SyncWaterfallHook<[string, Chunk]>;
  5262. linkPrefetch: SyncWaterfallHook<[string, Chunk]>;
  5263. }
  5264. declare class JsonpTemplatePlugin {
  5265. constructor();
  5266. /**
  5267. * Apply the plugin
  5268. */
  5269. apply(compiler: Compiler): void;
  5270. static getCompilationHooks(
  5271. compilation: Compilation
  5272. ): JsonpCompilationPluginHooks;
  5273. }
  5274. declare interface KnownAssetInfo {
  5275. /**
  5276. * true, if the asset can be long term cached forever (contains a hash)
  5277. */
  5278. immutable?: boolean;
  5279. /**
  5280. * whether the asset is minimized
  5281. */
  5282. minimized?: boolean;
  5283. /**
  5284. * the value(s) of the full hash used for this asset
  5285. */
  5286. fullhash?: string | string[];
  5287. /**
  5288. * the value(s) of the chunk hash used for this asset
  5289. */
  5290. chunkhash?: string | string[];
  5291. /**
  5292. * the value(s) of the module hash used for this asset
  5293. */
  5294. modulehash?: string | string[];
  5295. /**
  5296. * the value(s) of the content hash used for this asset
  5297. */
  5298. contenthash?: string | string[];
  5299. /**
  5300. * when asset was created from a source file (potentially transformed), the original filename relative to compilation context
  5301. */
  5302. sourceFilename?: string;
  5303. /**
  5304. * size in bytes, only set after asset has been emitted
  5305. */
  5306. size?: number;
  5307. /**
  5308. * true, when asset is only used for development and doesn't count towards user-facing assets
  5309. */
  5310. development?: boolean;
  5311. /**
  5312. * true, when asset ships data for updating an existing application (HMR)
  5313. */
  5314. hotModuleReplacement?: boolean;
  5315. /**
  5316. * true, when asset is javascript and an ESM
  5317. */
  5318. javascriptModule?: boolean;
  5319. /**
  5320. * object of pointers to other assets, keyed by type of relation (only points from parent to child)
  5321. */
  5322. related?: Record<string, string | string[]>;
  5323. }
  5324. declare interface KnownBuildMeta {
  5325. moduleArgument?: string;
  5326. exportsArgument?: string;
  5327. strict?: boolean;
  5328. moduleConcatenationBailout?: string;
  5329. exportsType?: "namespace" | "dynamic" | "default" | "flagged";
  5330. defaultObject?: false | "redirect" | "redirect-warn";
  5331. strictHarmonyModule?: boolean;
  5332. async?: boolean;
  5333. sideEffectFree?: boolean;
  5334. }
  5335. declare interface KnownCreateStatsOptionsContext {
  5336. forToString?: boolean;
  5337. }
  5338. declare interface KnownNormalizedStatsOptions {
  5339. context: string;
  5340. requestShortener: RequestShortener;
  5341. chunksSort: string;
  5342. modulesSort: string;
  5343. chunkModulesSort: string;
  5344. nestedModulesSort: string;
  5345. assetsSort: string;
  5346. ids: boolean;
  5347. cachedAssets: boolean;
  5348. groupAssetsByEmitStatus: boolean;
  5349. groupAssetsByPath: boolean;
  5350. groupAssetsByExtension: boolean;
  5351. assetsSpace: number;
  5352. excludeAssets: ((value: string, asset: StatsAsset) => boolean)[];
  5353. excludeModules: ((
  5354. name: string,
  5355. module: StatsModule,
  5356. type: "module" | "chunk" | "root-of-chunk" | "nested"
  5357. ) => boolean)[];
  5358. warningsFilter: ((warning: StatsError, textValue: string) => boolean)[];
  5359. cachedModules: boolean;
  5360. orphanModules: boolean;
  5361. dependentModules: boolean;
  5362. runtimeModules: boolean;
  5363. groupModulesByCacheStatus: boolean;
  5364. groupModulesByLayer: boolean;
  5365. groupModulesByAttributes: boolean;
  5366. groupModulesByPath: boolean;
  5367. groupModulesByExtension: boolean;
  5368. groupModulesByType: boolean;
  5369. entrypoints: boolean | "auto";
  5370. chunkGroups: boolean;
  5371. chunkGroupAuxiliary: boolean;
  5372. chunkGroupChildren: boolean;
  5373. chunkGroupMaxAssets: number;
  5374. modulesSpace: number;
  5375. chunkModulesSpace: number;
  5376. nestedModulesSpace: number;
  5377. logging: false | "none" | "error" | "warn" | "info" | "log" | "verbose";
  5378. loggingDebug: ((value: string) => boolean)[];
  5379. loggingTrace: boolean;
  5380. }
  5381. declare interface KnownStatsAsset {
  5382. type: string;
  5383. name: string;
  5384. info: AssetInfo;
  5385. size: number;
  5386. emitted: boolean;
  5387. comparedForEmit: boolean;
  5388. cached: boolean;
  5389. related?: StatsAsset[];
  5390. chunkNames?: (string | number)[];
  5391. chunkIdHints?: (string | number)[];
  5392. chunks?: (string | number)[];
  5393. auxiliaryChunkNames?: (string | number)[];
  5394. auxiliaryChunks?: (string | number)[];
  5395. auxiliaryChunkIdHints?: (string | number)[];
  5396. filteredRelated?: number;
  5397. isOverSizeLimit?: boolean;
  5398. }
  5399. declare interface KnownStatsChunk {
  5400. rendered: boolean;
  5401. initial: boolean;
  5402. entry: boolean;
  5403. recorded: boolean;
  5404. reason?: string;
  5405. size: number;
  5406. sizes?: Record<string, number>;
  5407. names?: string[];
  5408. idHints?: string[];
  5409. runtime?: string[];
  5410. files?: string[];
  5411. auxiliaryFiles?: string[];
  5412. hash: string;
  5413. childrenByOrder?: Record<string, (string | number)[]>;
  5414. id?: string | number;
  5415. siblings?: (string | number)[];
  5416. parents?: (string | number)[];
  5417. children?: (string | number)[];
  5418. modules?: StatsModule[];
  5419. filteredModules?: number;
  5420. origins?: StatsChunkOrigin[];
  5421. }
  5422. declare interface KnownStatsChunkGroup {
  5423. name?: string;
  5424. chunks?: (string | number)[];
  5425. assets?: { name: string; size?: number }[];
  5426. filteredAssets?: number;
  5427. assetsSize?: number;
  5428. auxiliaryAssets?: { name: string; size?: number }[];
  5429. filteredAuxiliaryAssets?: number;
  5430. auxiliaryAssetsSize?: number;
  5431. children?: { [index: string]: StatsChunkGroup[] };
  5432. childAssets?: { [index: string]: string[] };
  5433. isOverSizeLimit?: boolean;
  5434. }
  5435. declare interface KnownStatsChunkOrigin {
  5436. module?: string;
  5437. moduleIdentifier?: string;
  5438. moduleName?: string;
  5439. loc?: string;
  5440. request?: string;
  5441. moduleId?: string | number;
  5442. }
  5443. declare interface KnownStatsCompilation {
  5444. env?: any;
  5445. name?: string;
  5446. hash?: string;
  5447. version?: string;
  5448. time?: number;
  5449. builtAt?: number;
  5450. needAdditionalPass?: boolean;
  5451. publicPath?: string;
  5452. outputPath?: string;
  5453. assetsByChunkName?: Record<string, string[]>;
  5454. assets?: StatsAsset[];
  5455. filteredAssets?: number;
  5456. chunks?: StatsChunk[];
  5457. modules?: StatsModule[];
  5458. filteredModules?: number;
  5459. entrypoints?: Record<string, StatsChunkGroup>;
  5460. namedChunkGroups?: Record<string, StatsChunkGroup>;
  5461. errors?: StatsError[];
  5462. errorsCount?: number;
  5463. warnings?: StatsError[];
  5464. warningsCount?: number;
  5465. children?: StatsCompilation[];
  5466. logging?: Record<string, StatsLogging>;
  5467. }
  5468. declare interface KnownStatsError {
  5469. message: string;
  5470. chunkName?: string;
  5471. chunkEntry?: boolean;
  5472. chunkInitial?: boolean;
  5473. file?: string;
  5474. moduleIdentifier?: string;
  5475. moduleName?: string;
  5476. loc?: string;
  5477. chunkId?: string | number;
  5478. moduleId?: string | number;
  5479. moduleTrace?: StatsModuleTraceItem[];
  5480. details?: any;
  5481. stack?: string;
  5482. }
  5483. declare interface KnownStatsFactoryContext {
  5484. type: string;
  5485. makePathsRelative?: (arg0: string) => string;
  5486. compilation?: Compilation;
  5487. rootModules?: Set<Module>;
  5488. compilationFileToChunks?: Map<string, Chunk[]>;
  5489. compilationAuxiliaryFileToChunks?: Map<string, Chunk[]>;
  5490. runtime?: RuntimeSpec;
  5491. cachedGetErrors?: (arg0: Compilation) => WebpackError[];
  5492. cachedGetWarnings?: (arg0: Compilation) => WebpackError[];
  5493. }
  5494. declare interface KnownStatsLogging {
  5495. entries: StatsLoggingEntry[];
  5496. filteredEntries: number;
  5497. debug: boolean;
  5498. }
  5499. declare interface KnownStatsLoggingEntry {
  5500. type: string;
  5501. message: string;
  5502. trace?: string[];
  5503. children?: StatsLoggingEntry[];
  5504. args?: any[];
  5505. time?: number;
  5506. }
  5507. declare interface KnownStatsModule {
  5508. type?: string;
  5509. moduleType?: string;
  5510. layer?: string;
  5511. identifier?: string;
  5512. name?: string;
  5513. nameForCondition?: string;
  5514. index?: number;
  5515. preOrderIndex?: number;
  5516. index2?: number;
  5517. postOrderIndex?: number;
  5518. size?: number;
  5519. sizes?: { [index: string]: number };
  5520. cacheable?: boolean;
  5521. built?: boolean;
  5522. codeGenerated?: boolean;
  5523. buildTimeExecuted?: boolean;
  5524. cached?: boolean;
  5525. optional?: boolean;
  5526. orphan?: boolean;
  5527. id?: string | number;
  5528. issuerId?: string | number;
  5529. chunks?: (string | number)[];
  5530. assets?: (string | number)[];
  5531. dependent?: boolean;
  5532. issuer?: string;
  5533. issuerName?: string;
  5534. issuerPath?: StatsModuleIssuer[];
  5535. failed?: boolean;
  5536. errors?: number;
  5537. warnings?: number;
  5538. profile?: StatsProfile;
  5539. reasons?: StatsModuleReason[];
  5540. usedExports?: boolean | string[];
  5541. providedExports?: string[];
  5542. optimizationBailout?: string[];
  5543. depth?: number;
  5544. modules?: StatsModule[];
  5545. filteredModules?: number;
  5546. source?: string | Buffer;
  5547. }
  5548. declare interface KnownStatsModuleIssuer {
  5549. identifier?: string;
  5550. name?: string;
  5551. id?: string | number;
  5552. profile?: StatsProfile;
  5553. }
  5554. declare interface KnownStatsModuleReason {
  5555. moduleIdentifier?: string;
  5556. module?: string;
  5557. moduleName?: string;
  5558. resolvedModuleIdentifier?: string;
  5559. resolvedModule?: string;
  5560. type?: string;
  5561. active: boolean;
  5562. explanation?: string;
  5563. userRequest?: string;
  5564. loc?: string;
  5565. moduleId?: string | number;
  5566. resolvedModuleId?: string | number;
  5567. }
  5568. declare interface KnownStatsModuleTraceDependency {
  5569. loc?: string;
  5570. }
  5571. declare interface KnownStatsModuleTraceItem {
  5572. originIdentifier?: string;
  5573. originName?: string;
  5574. moduleIdentifier?: string;
  5575. moduleName?: string;
  5576. dependencies?: StatsModuleTraceDependency[];
  5577. originId?: string | number;
  5578. moduleId?: string | number;
  5579. }
  5580. declare interface KnownStatsPrinterContext {
  5581. type?: string;
  5582. compilation?: StatsCompilation;
  5583. chunkGroup?: StatsChunkGroup;
  5584. asset?: StatsAsset;
  5585. module?: StatsModule;
  5586. chunk?: StatsChunk;
  5587. moduleReason?: StatsModuleReason;
  5588. bold?: (str: string) => string;
  5589. yellow?: (str: string) => string;
  5590. red?: (str: string) => string;
  5591. green?: (str: string) => string;
  5592. magenta?: (str: string) => string;
  5593. cyan?: (str: string) => string;
  5594. formatFilename?: (file: string, oversize?: boolean) => string;
  5595. formatModuleId?: (id: string) => string;
  5596. formatChunkId?: (
  5597. id: string,
  5598. direction?: "parent" | "child" | "sibling"
  5599. ) => string;
  5600. formatSize?: (size: number) => string;
  5601. formatDateTime?: (dateTime: number) => string;
  5602. formatFlag?: (flag: string) => string;
  5603. formatTime?: (time: number, boldQuantity?: boolean) => string;
  5604. chunkGroupKind?: string;
  5605. }
  5606. declare interface KnownStatsProfile {
  5607. total: number;
  5608. resolving: number;
  5609. restoring: number;
  5610. building: number;
  5611. integration: number;
  5612. storing: number;
  5613. additionalResolving: number;
  5614. additionalIntegration: number;
  5615. factory: number;
  5616. dependencies: number;
  5617. }
  5618. /**
  5619. * Options for the default backend.
  5620. */
  5621. declare interface LazyCompilationDefaultBackendOptions {
  5622. /**
  5623. * A custom client.
  5624. */
  5625. client?: string;
  5626. /**
  5627. * Specifies where to listen to from the server.
  5628. */
  5629. listen?: number | ListenOptions | ((server: typeof Server) => void);
  5630. /**
  5631. * Specifies the protocol the client should use to connect to the server.
  5632. */
  5633. protocol?: "http" | "https";
  5634. /**
  5635. * Specifies how to create the server handling the EventSource requests.
  5636. */
  5637. server?: ServerOptionsImport | ServerOptionsHttps | (() => typeof Server);
  5638. }
  5639. /**
  5640. * Options for compiling entrypoints and import()s only when they are accessed.
  5641. */
  5642. declare interface LazyCompilationOptions {
  5643. /**
  5644. * Specifies the backend that should be used for handling client keep alive.
  5645. */
  5646. backend?:
  5647. | ((
  5648. compiler: Compiler,
  5649. callback: (err?: Error, api?: BackendApi) => void
  5650. ) => void)
  5651. | ((compiler: Compiler) => Promise<BackendApi>)
  5652. | LazyCompilationDefaultBackendOptions;
  5653. /**
  5654. * Enable/disable lazy compilation for entries.
  5655. */
  5656. entries?: boolean;
  5657. /**
  5658. * Enable/disable lazy compilation for import() modules.
  5659. */
  5660. imports?: boolean;
  5661. /**
  5662. * Specify which entrypoints or import()ed modules should be lazily compiled. This is matched with the imported module and not the entrypoint name.
  5663. */
  5664. test?: string | RegExp | ((module: Module) => boolean);
  5665. }
  5666. declare class LazySet<T> {
  5667. constructor(iterable?: Iterable<T>);
  5668. readonly size: number;
  5669. add(item: T): LazySet<T>;
  5670. addAll(iterable: LazySet<T> | Iterable<T>): LazySet<T>;
  5671. clear(): void;
  5672. delete(value: T): boolean;
  5673. entries(): IterableIterator<[T, T]>;
  5674. forEach(
  5675. callbackFn: (arg0: T, arg1: T, arg2: Set<T>) => void,
  5676. thisArg?: any
  5677. ): void;
  5678. has(item: T): boolean;
  5679. keys(): IterableIterator<T>;
  5680. values(): IterableIterator<T>;
  5681. serialize(__0: { write: any }): void;
  5682. [Symbol.iterator](): IterableIterator<T>;
  5683. static deserialize(__0: { read: any }): LazySet<any>;
  5684. }
  5685. declare interface LibIdentOptions {
  5686. /**
  5687. * absolute context path to which lib ident is relative to
  5688. */
  5689. context: string;
  5690. /**
  5691. * object for caching
  5692. */
  5693. associatedObjectForCache?: Object;
  5694. }
  5695. declare class LibManifestPlugin {
  5696. constructor(options?: any);
  5697. options: any;
  5698. /**
  5699. * Apply the plugin
  5700. */
  5701. apply(compiler: Compiler): void;
  5702. }
  5703. declare interface LibraryContext<T> {
  5704. compilation: Compilation;
  5705. chunkGraph: ChunkGraph;
  5706. options: T;
  5707. }
  5708. /**
  5709. * Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.
  5710. */
  5711. declare interface LibraryCustomUmdCommentObject {
  5712. /**
  5713. * Set comment for `amd` section in UMD.
  5714. */
  5715. amd?: string;
  5716. /**
  5717. * Set comment for `commonjs` (exports) section in UMD.
  5718. */
  5719. commonjs?: string;
  5720. /**
  5721. * Set comment for `commonjs2` (module.exports) section in UMD.
  5722. */
  5723. commonjs2?: string;
  5724. /**
  5725. * Set comment for `root` (global variable) section in UMD.
  5726. */
  5727. root?: string;
  5728. }
  5729. /**
  5730. * Description object for all UMD variants of the library name.
  5731. */
  5732. declare interface LibraryCustomUmdObject {
  5733. /**
  5734. * Name of the exposed AMD library in the UMD.
  5735. */
  5736. amd?: string;
  5737. /**
  5738. * Name of the exposed commonjs export in the UMD.
  5739. */
  5740. commonjs?: string;
  5741. /**
  5742. * Name of the property exposed globally by a UMD library.
  5743. */
  5744. root?: string | string[];
  5745. }
  5746. type LibraryExport = string | string[];
  5747. type LibraryName = string | string[] | LibraryCustomUmdObject;
  5748. /**
  5749. * Options for library.
  5750. */
  5751. declare interface LibraryOptions {
  5752. /**
  5753. * Add a comment in the UMD wrapper.
  5754. */
  5755. auxiliaryComment?: string | LibraryCustomUmdCommentObject;
  5756. /**
  5757. * Specify which export should be exposed as library.
  5758. */
  5759. export?: string | string[];
  5760. /**
  5761. * The name of the library (some types allow unnamed libraries too).
  5762. */
  5763. name?: string | string[] | LibraryCustomUmdObject;
  5764. /**
  5765. * Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
  5766. */
  5767. type: string;
  5768. /**
  5769. * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
  5770. */
  5771. umdNamedDefine?: boolean;
  5772. }
  5773. declare class LibraryTemplatePlugin {
  5774. constructor(
  5775. name: LibraryName,
  5776. target: string,
  5777. umdNamedDefine: boolean,
  5778. auxiliaryComment: AuxiliaryComment,
  5779. exportProperty: LibraryExport
  5780. );
  5781. library: {
  5782. type: string;
  5783. name: LibraryName;
  5784. umdNamedDefine: boolean;
  5785. auxiliaryComment: AuxiliaryComment;
  5786. export: LibraryExport;
  5787. };
  5788. /**
  5789. * Apply the plugin
  5790. */
  5791. apply(compiler: Compiler): void;
  5792. }
  5793. declare class LimitChunkCountPlugin {
  5794. constructor(options?: LimitChunkCountPluginOptions);
  5795. options?: LimitChunkCountPluginOptions;
  5796. apply(compiler: Compiler): void;
  5797. }
  5798. declare interface LimitChunkCountPluginOptions {
  5799. /**
  5800. * Constant overhead for a chunk.
  5801. */
  5802. chunkOverhead?: number;
  5803. /**
  5804. * Multiplicator for initial chunks.
  5805. */
  5806. entryChunkMultiplicator?: number;
  5807. /**
  5808. * Limit the maximum number of chunks using a value greater greater than or equal to 1.
  5809. */
  5810. maxChunks: number;
  5811. }
  5812. declare interface LoadScriptCompilationHooks {
  5813. createScript: SyncWaterfallHook<[string, Chunk]>;
  5814. }
  5815. declare class LoadScriptRuntimeModule extends HelperRuntimeModule {
  5816. constructor(withCreateScriptUrl?: boolean);
  5817. static getCompilationHooks(
  5818. compilation: Compilation
  5819. ): LoadScriptCompilationHooks;
  5820. /**
  5821. * Runtime modules without any dependencies to other runtime modules
  5822. */
  5823. static STAGE_NORMAL: number;
  5824. /**
  5825. * Runtime modules with simple dependencies on other runtime modules
  5826. */
  5827. static STAGE_BASIC: number;
  5828. /**
  5829. * Runtime modules which attach to handlers of other runtime modules
  5830. */
  5831. static STAGE_ATTACH: number;
  5832. /**
  5833. * Runtime modules which trigger actions on bootstrap
  5834. */
  5835. static STAGE_TRIGGER: number;
  5836. }
  5837. /**
  5838. * Custom values available in the loader context.
  5839. */
  5840. declare interface Loader {
  5841. [index: string]: any;
  5842. }
  5843. type LoaderContext<OptionsType> = NormalModuleLoaderContext<OptionsType> &
  5844. LoaderRunnerLoaderContext<OptionsType> &
  5845. LoaderPluginLoaderContext &
  5846. HotModuleReplacementPluginLoaderContext;
  5847. type LoaderDefinition<
  5848. OptionsType = {},
  5849. ContextAdditions = {}
  5850. > = LoaderDefinitionFunction<OptionsType, ContextAdditions> & {
  5851. raw?: false;
  5852. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  5853. };
  5854. declare interface LoaderDefinitionFunction<
  5855. OptionsType = {},
  5856. ContextAdditions = {}
  5857. > {
  5858. (
  5859. this: NormalModuleLoaderContext<OptionsType> &
  5860. LoaderRunnerLoaderContext<OptionsType> &
  5861. LoaderPluginLoaderContext &
  5862. HotModuleReplacementPluginLoaderContext &
  5863. ContextAdditions,
  5864. content: string,
  5865. sourceMap?: string | SourceMap,
  5866. additionalData?: AdditionalData
  5867. ): string | void | Buffer | Promise<string | Buffer>;
  5868. }
  5869. declare interface LoaderItem {
  5870. loader: string;
  5871. options: any;
  5872. ident: null | string;
  5873. type: null | string;
  5874. }
  5875. declare interface LoaderModule<OptionsType = {}, ContextAdditions = {}> {
  5876. default?:
  5877. | RawLoaderDefinitionFunction<OptionsType, ContextAdditions>
  5878. | LoaderDefinitionFunction<OptionsType, ContextAdditions>;
  5879. raw?: false;
  5880. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  5881. }
  5882. declare class LoaderOptionsPlugin {
  5883. constructor(options?: LoaderOptionsPluginOptions);
  5884. options: LoaderOptionsPluginOptions;
  5885. /**
  5886. * Apply the plugin
  5887. */
  5888. apply(compiler: Compiler): void;
  5889. }
  5890. declare interface LoaderOptionsPluginOptions {
  5891. [index: string]: any;
  5892. /**
  5893. * Whether loaders should be in debug mode or not. debug will be removed as of webpack 3.
  5894. */
  5895. debug?: boolean;
  5896. /**
  5897. * Where loaders can be switched to minimize mode.
  5898. */
  5899. minimize?: boolean;
  5900. /**
  5901. * A configuration object that can be used to configure older loaders.
  5902. */
  5903. options?: {
  5904. [index: string]: any;
  5905. /**
  5906. * The context that can be used to configure older loaders.
  5907. */
  5908. context?: string;
  5909. };
  5910. }
  5911. /**
  5912. * These properties are added by the LoaderPlugin
  5913. */
  5914. declare interface LoaderPluginLoaderContext {
  5915. /**
  5916. * Resolves the given request to a module, applies all configured loaders and calls
  5917. * back with the generated source, the sourceMap and the module instance (usually an
  5918. * instance of NormalModule). Use this function if you need to know the source code
  5919. * of another module to generate the result.
  5920. */
  5921. loadModule(
  5922. request: string,
  5923. callback: (
  5924. err: null | Error,
  5925. source: string,
  5926. sourceMap: any,
  5927. module: NormalModule
  5928. ) => void
  5929. ): void;
  5930. importModule(
  5931. request: string,
  5932. options: ImportModuleOptions,
  5933. callback: (err?: null | Error, exports?: any) => any
  5934. ): void;
  5935. importModule(request: string, options?: ImportModuleOptions): Promise<any>;
  5936. }
  5937. /**
  5938. * The properties are added by https://github.com/webpack/loader-runner
  5939. */
  5940. declare interface LoaderRunnerLoaderContext<OptionsType> {
  5941. /**
  5942. * Add a directory as dependency of the loader result.
  5943. */
  5944. addContextDependency(context: string): void;
  5945. /**
  5946. * Adds a file as dependency of the loader result in order to make them watchable.
  5947. * For example, html-loader uses this technique as it finds src and src-set attributes.
  5948. * Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
  5949. */
  5950. addDependency(file: string): void;
  5951. addMissingDependency(context: string): void;
  5952. /**
  5953. * Make this loader async.
  5954. */
  5955. async(): (
  5956. err?: null | Error,
  5957. content?: string | Buffer,
  5958. sourceMap?: string | SourceMap,
  5959. additionalData?: AdditionalData
  5960. ) => void;
  5961. /**
  5962. * Make this loader result cacheable. By default it's cacheable.
  5963. * A cacheable loader must have a deterministic result, when inputs and dependencies haven't changed.
  5964. * This means the loader shouldn't have other dependencies than specified with this.addDependency.
  5965. * Most loaders are deterministic and cacheable.
  5966. */
  5967. cacheable(flag?: boolean): void;
  5968. callback: (
  5969. err?: null | Error,
  5970. content?: string | Buffer,
  5971. sourceMap?: string | SourceMap,
  5972. additionalData?: AdditionalData
  5973. ) => void;
  5974. /**
  5975. * Remove all dependencies of the loader result. Even initial dependencies and these of other loaders.
  5976. */
  5977. clearDependencies(): void;
  5978. /**
  5979. * The directory of the module. Can be used as context for resolving other stuff.
  5980. * eg '/workspaces/ts-loader/examples/vanilla/src'
  5981. */
  5982. context: string;
  5983. readonly currentRequest: string;
  5984. readonly data: any;
  5985. /**
  5986. * alias of addDependency
  5987. * Adds a file as dependency of the loader result in order to make them watchable.
  5988. * For example, html-loader uses this technique as it finds src and src-set attributes.
  5989. * Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
  5990. */
  5991. dependency(file: string): void;
  5992. getContextDependencies(): string[];
  5993. getDependencies(): string[];
  5994. getMissingDependencies(): string[];
  5995. /**
  5996. * The index in the loaders array of the current loader.
  5997. * In the example: in loader1: 0, in loader2: 1
  5998. */
  5999. loaderIndex: number;
  6000. readonly previousRequest: string;
  6001. readonly query: string | OptionsType;
  6002. readonly remainingRequest: string;
  6003. readonly request: string;
  6004. /**
  6005. * An array of all the loaders. It is writeable in the pitch phase.
  6006. * loaders = [{request: string, path: string, query: string, module: function}]
  6007. * In the example:
  6008. * [
  6009. * { request: "/abc/loader1.js?xyz",
  6010. * path: "/abc/loader1.js",
  6011. * query: "?xyz",
  6012. * module: [Function]
  6013. * },
  6014. * { request: "/abc/node_modules/loader2/index.js",
  6015. * path: "/abc/node_modules/loader2/index.js",
  6016. * query: "",
  6017. * module: [Function]
  6018. * }
  6019. * ]
  6020. */
  6021. loaders: {
  6022. request: string;
  6023. path: string;
  6024. query: string;
  6025. fragment: string;
  6026. options?: string | object;
  6027. ident: string;
  6028. normal?: Function;
  6029. pitch?: Function;
  6030. raw?: boolean;
  6031. data?: object;
  6032. pitchExecuted: boolean;
  6033. normalExecuted: boolean;
  6034. }[];
  6035. /**
  6036. * The resource path.
  6037. * In the example: "/abc/resource.js"
  6038. */
  6039. resourcePath: string;
  6040. /**
  6041. * The resource query string.
  6042. * Example: "?query"
  6043. */
  6044. resourceQuery: string;
  6045. /**
  6046. * The resource fragment.
  6047. * Example: "#frag"
  6048. */
  6049. resourceFragment: string;
  6050. /**
  6051. * The resource inclusive query and fragment.
  6052. * Example: "/abc/resource.js?query#frag"
  6053. */
  6054. resource: string;
  6055. }
  6056. declare class LoaderTargetPlugin {
  6057. constructor(target: string);
  6058. target: string;
  6059. /**
  6060. * Apply the plugin
  6061. */
  6062. apply(compiler: Compiler): void;
  6063. }
  6064. declare interface LogEntry {
  6065. type: string;
  6066. args: any[];
  6067. time: number;
  6068. trace?: string[];
  6069. }
  6070. declare const MEASURE_END_OPERATION: unique symbol;
  6071. declare const MEASURE_START_OPERATION: unique symbol;
  6072. declare interface MainRenderContext {
  6073. /**
  6074. * the chunk
  6075. */
  6076. chunk: Chunk;
  6077. /**
  6078. * the dependency templates
  6079. */
  6080. dependencyTemplates: DependencyTemplates;
  6081. /**
  6082. * the runtime template
  6083. */
  6084. runtimeTemplate: RuntimeTemplate;
  6085. /**
  6086. * the module graph
  6087. */
  6088. moduleGraph: ModuleGraph;
  6089. /**
  6090. * the chunk graph
  6091. */
  6092. chunkGraph: ChunkGraph;
  6093. /**
  6094. * results of code generation
  6095. */
  6096. codeGenerationResults: CodeGenerationResults;
  6097. /**
  6098. * hash to be used for render call
  6099. */
  6100. hash: string;
  6101. /**
  6102. * rendering in strict context
  6103. */
  6104. strictMode: boolean;
  6105. }
  6106. declare abstract class MainTemplate {
  6107. hooks: Readonly<{
  6108. renderManifest: { tap: (options?: any, fn?: any) => void };
  6109. modules: { tap: () => never };
  6110. moduleObj: { tap: () => never };
  6111. require: { tap: (options?: any, fn?: any) => void };
  6112. beforeStartup: { tap: () => never };
  6113. startup: { tap: () => never };
  6114. afterStartup: { tap: () => never };
  6115. render: { tap: (options?: any, fn?: any) => void };
  6116. renderWithEntry: { tap: (options?: any, fn?: any) => void };
  6117. assetPath: {
  6118. tap: (options?: any, fn?: any) => void;
  6119. call: (filename?: any, options?: any) => string;
  6120. };
  6121. hash: { tap: (options?: any, fn?: any) => void };
  6122. hashForChunk: { tap: (options?: any, fn?: any) => void };
  6123. globalHashPaths: { tap: () => void };
  6124. globalHash: { tap: () => void };
  6125. hotBootstrap: { tap: () => never };
  6126. bootstrap: SyncWaterfallHook<
  6127. [string, Chunk, string, ModuleTemplate, DependencyTemplates]
  6128. >;
  6129. localVars: SyncWaterfallHook<[string, Chunk, string]>;
  6130. requireExtensions: SyncWaterfallHook<[string, Chunk, string]>;
  6131. requireEnsure: SyncWaterfallHook<[string, Chunk, string, string]>;
  6132. readonly jsonpScript: SyncWaterfallHook<[string, Chunk]>;
  6133. readonly linkPrefetch: SyncWaterfallHook<[string, Chunk]>;
  6134. readonly linkPreload: SyncWaterfallHook<[string, Chunk]>;
  6135. }>;
  6136. renderCurrentHashCode: (hash: string, length?: number) => string;
  6137. getPublicPath: (options: object) => string;
  6138. getAssetPath: (path?: any, options?: any) => string;
  6139. getAssetPathWithInfo: (
  6140. path?: any,
  6141. options?: any
  6142. ) => { path: string; info: AssetInfo };
  6143. readonly requireFn: "__webpack_require__";
  6144. readonly outputOptions: Output;
  6145. }
  6146. declare interface MapOptions {
  6147. columns?: boolean;
  6148. module?: boolean;
  6149. }
  6150. /**
  6151. * Options object for in-memory caching.
  6152. */
  6153. declare interface MemoryCacheOptions {
  6154. /**
  6155. * Additionally cache computation of modules that are unchanged and reference only unchanged modules.
  6156. */
  6157. cacheUnaffected?: boolean;
  6158. /**
  6159. * Number of generations unused cache entries stay in memory cache at minimum (1 = may be removed after unused for a single compilation, ..., Infinity: kept forever).
  6160. */
  6161. maxGenerations?: number;
  6162. /**
  6163. * In memory caching.
  6164. */
  6165. type: "memory";
  6166. }
  6167. declare class MemoryCachePlugin {
  6168. constructor();
  6169. /**
  6170. * Apply the plugin
  6171. */
  6172. apply(compiler: Compiler): void;
  6173. }
  6174. declare class MinChunkSizePlugin {
  6175. constructor(options: MinChunkSizePluginOptions);
  6176. options: MinChunkSizePluginOptions;
  6177. /**
  6178. * Apply the plugin
  6179. */
  6180. apply(compiler: Compiler): void;
  6181. }
  6182. declare interface MinChunkSizePluginOptions {
  6183. /**
  6184. * Constant overhead for a chunk.
  6185. */
  6186. chunkOverhead?: number;
  6187. /**
  6188. * Multiplicator for initial chunks.
  6189. */
  6190. entryChunkMultiplicator?: number;
  6191. /**
  6192. * Minimum number of characters.
  6193. */
  6194. minChunkSize: number;
  6195. }
  6196. declare class Module extends DependenciesBlock {
  6197. constructor(type: string, context?: string, layer?: string);
  6198. type: string;
  6199. context: null | string;
  6200. layer: null | string;
  6201. needId: boolean;
  6202. debugId: number;
  6203. resolveOptions: ResolveOptionsWebpackOptions;
  6204. factoryMeta?: object;
  6205. useSourceMap: boolean;
  6206. useSimpleSourceMap: boolean;
  6207. buildMeta: BuildMeta;
  6208. buildInfo: Record<string, any>;
  6209. presentationalDependencies?: Dependency[];
  6210. codeGenerationDependencies?: Dependency[];
  6211. id: string | number;
  6212. readonly hash: string;
  6213. readonly renderedHash: string;
  6214. profile: null | ModuleProfile;
  6215. index: number;
  6216. index2: number;
  6217. depth: number;
  6218. issuer: null | Module;
  6219. readonly usedExports: null | boolean | SortableSet<string>;
  6220. readonly optimizationBailout: (
  6221. | string
  6222. | ((requestShortener: RequestShortener) => string)
  6223. )[];
  6224. readonly optional: boolean;
  6225. addChunk(chunk?: any): boolean;
  6226. removeChunk(chunk?: any): void;
  6227. isInChunk(chunk?: any): boolean;
  6228. isEntryModule(): boolean;
  6229. getChunks(): Chunk[];
  6230. getNumberOfChunks(): number;
  6231. readonly chunksIterable: Iterable<Chunk>;
  6232. isProvided(exportName: string): null | boolean;
  6233. readonly exportsArgument: string;
  6234. readonly moduleArgument: string;
  6235. getExportsType(
  6236. moduleGraph: ModuleGraph,
  6237. strict: boolean
  6238. ): "namespace" | "default-only" | "default-with-named" | "dynamic";
  6239. addPresentationalDependency(presentationalDependency: Dependency): void;
  6240. addCodeGenerationDependency(codeGenerationDependency: Dependency): void;
  6241. addWarning(warning: WebpackError): void;
  6242. getWarnings(): undefined | Iterable<WebpackError>;
  6243. getNumberOfWarnings(): number;
  6244. addError(error: WebpackError): void;
  6245. getErrors(): undefined | Iterable<WebpackError>;
  6246. getNumberOfErrors(): number;
  6247. /**
  6248. * removes all warnings and errors
  6249. */
  6250. clearWarningsAndErrors(): void;
  6251. isOptional(moduleGraph: ModuleGraph): boolean;
  6252. isAccessibleInChunk(
  6253. chunkGraph: ChunkGraph,
  6254. chunk: Chunk,
  6255. ignoreChunk?: Chunk
  6256. ): boolean;
  6257. isAccessibleInChunkGroup(
  6258. chunkGraph: ChunkGraph,
  6259. chunkGroup: ChunkGroup,
  6260. ignoreChunk?: Chunk
  6261. ): boolean;
  6262. hasReasonForChunk(
  6263. chunk: Chunk,
  6264. moduleGraph: ModuleGraph,
  6265. chunkGraph: ChunkGraph
  6266. ): boolean;
  6267. hasReasons(moduleGraph: ModuleGraph, runtime: RuntimeSpec): boolean;
  6268. needBuild(
  6269. context: NeedBuildContext,
  6270. callback: (arg0?: null | WebpackError, arg1?: boolean) => void
  6271. ): void;
  6272. needRebuild(
  6273. fileTimestamps: Map<string, null | number>,
  6274. contextTimestamps: Map<string, null | number>
  6275. ): boolean;
  6276. invalidateBuild(): void;
  6277. identifier(): string;
  6278. readableIdentifier(requestShortener: RequestShortener): string;
  6279. build(
  6280. options: WebpackOptionsNormalized,
  6281. compilation: Compilation,
  6282. resolver: ResolverWithOptions,
  6283. fs: InputFileSystem,
  6284. callback: (arg0?: WebpackError) => void
  6285. ): void;
  6286. getSourceTypes(): Set<string>;
  6287. source(
  6288. dependencyTemplates: DependencyTemplates,
  6289. runtimeTemplate: RuntimeTemplate,
  6290. type?: string
  6291. ): Source;
  6292. size(type?: string): number;
  6293. libIdent(options: LibIdentOptions): null | string;
  6294. nameForCondition(): null | string;
  6295. getConcatenationBailoutReason(
  6296. context: ConcatenationBailoutReasonContext
  6297. ): undefined | string;
  6298. getSideEffectsConnectionState(moduleGraph: ModuleGraph): ConnectionState;
  6299. codeGeneration(context: CodeGenerationContext): CodeGenerationResult;
  6300. chunkCondition(chunk: Chunk, compilation: Compilation): boolean;
  6301. hasChunkCondition(): boolean;
  6302. /**
  6303. * Assuming this module is in the cache. Update the (cached) module with
  6304. * the fresh module from the factory. Usually updates internal references
  6305. * and properties.
  6306. */
  6307. updateCacheModule(module: Module): void;
  6308. /**
  6309. * Module should be unsafe cached. Get data that's needed for that.
  6310. * This data will be passed to restoreFromUnsafeCache later.
  6311. */
  6312. getUnsafeCacheData(): object;
  6313. /**
  6314. * Assuming this module is in the cache. Remove internal references to allow freeing some memory.
  6315. */
  6316. cleanupForCache(): void;
  6317. originalSource(): null | Source;
  6318. addCacheDependencies(
  6319. fileDependencies: LazySet<string>,
  6320. contextDependencies: LazySet<string>,
  6321. missingDependencies: LazySet<string>,
  6322. buildDependencies: LazySet<string>
  6323. ): void;
  6324. readonly hasEqualsChunks: any;
  6325. readonly isUsed: any;
  6326. readonly errors: any;
  6327. readonly warnings: any;
  6328. used: any;
  6329. }
  6330. declare class ModuleConcatenationPlugin {
  6331. constructor(options?: any);
  6332. options: any;
  6333. /**
  6334. * Apply the plugin
  6335. */
  6336. apply(compiler: Compiler): void;
  6337. }
  6338. declare class ModuleDependency extends Dependency {
  6339. constructor(request: string);
  6340. request: string;
  6341. userRequest: string;
  6342. range: any;
  6343. assertions?: Record<string, any>;
  6344. static Template: typeof DependencyTemplate;
  6345. static NO_EXPORTS_REFERENCED: string[][];
  6346. static EXPORTS_OBJECT_REFERENCED: string[][];
  6347. static TRANSITIVE: typeof TRANSITIVE;
  6348. }
  6349. declare abstract class ModuleFactory {
  6350. create(
  6351. data: ModuleFactoryCreateData,
  6352. callback: (arg0?: Error, arg1?: ModuleFactoryResult) => void
  6353. ): void;
  6354. }
  6355. declare interface ModuleFactoryCreateData {
  6356. contextInfo: ModuleFactoryCreateDataContextInfo;
  6357. resolveOptions?: ResolveOptionsWebpackOptions;
  6358. context: string;
  6359. dependencies: Dependency[];
  6360. }
  6361. declare interface ModuleFactoryCreateDataContextInfo {
  6362. issuer: string;
  6363. issuerLayer?: null | string;
  6364. compiler: string;
  6365. }
  6366. declare interface ModuleFactoryResult {
  6367. /**
  6368. * the created module or unset if no module was created
  6369. */
  6370. module?: Module;
  6371. fileDependencies?: Set<string>;
  6372. contextDependencies?: Set<string>;
  6373. missingDependencies?: Set<string>;
  6374. /**
  6375. * allow to use the unsafe cache
  6376. */
  6377. cacheable?: boolean;
  6378. }
  6379. declare class ModuleFederationPlugin {
  6380. constructor(options: ModuleFederationPluginOptions);
  6381. /**
  6382. * Apply the plugin
  6383. */
  6384. apply(compiler: Compiler): void;
  6385. }
  6386. declare interface ModuleFederationPluginOptions {
  6387. /**
  6388. * Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.
  6389. */
  6390. exposes?: (string | ExposesObject)[] | ExposesObject;
  6391. /**
  6392. * The filename of the container as relative path inside the `output.path` directory.
  6393. */
  6394. filename?: string;
  6395. /**
  6396. * Options for library.
  6397. */
  6398. library?: LibraryOptions;
  6399. /**
  6400. * The name of the container.
  6401. */
  6402. name?: string;
  6403. /**
  6404. * The external type of the remote containers.
  6405. */
  6406. remoteType?:
  6407. | "import"
  6408. | "var"
  6409. | "module"
  6410. | "assign"
  6411. | "this"
  6412. | "window"
  6413. | "self"
  6414. | "global"
  6415. | "commonjs"
  6416. | "commonjs2"
  6417. | "commonjs-module"
  6418. | "commonjs-static"
  6419. | "amd"
  6420. | "amd-require"
  6421. | "umd"
  6422. | "umd2"
  6423. | "jsonp"
  6424. | "system"
  6425. | "promise"
  6426. | "script"
  6427. | "node-commonjs";
  6428. /**
  6429. * Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.
  6430. */
  6431. remotes?: (string | RemotesObject)[] | RemotesObject;
  6432. /**
  6433. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  6434. */
  6435. runtime?: string | false;
  6436. /**
  6437. * Share scope name used for all shared modules (defaults to 'default').
  6438. */
  6439. shareScope?: string;
  6440. /**
  6441. * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
  6442. */
  6443. shared?: (string | SharedObject)[] | SharedObject;
  6444. }
  6445. type ModuleFilterItemTypes =
  6446. | string
  6447. | RegExp
  6448. | ((
  6449. name: string,
  6450. module: StatsModule,
  6451. type: "module" | "chunk" | "root-of-chunk" | "nested"
  6452. ) => boolean);
  6453. declare class ModuleGraph {
  6454. constructor();
  6455. setParents(
  6456. dependency: Dependency,
  6457. block: DependenciesBlock,
  6458. module: Module,
  6459. indexInBlock?: number
  6460. ): void;
  6461. getParentModule(dependency: Dependency): Module;
  6462. getParentBlock(dependency: Dependency): DependenciesBlock;
  6463. getParentBlockIndex(dependency: Dependency): number;
  6464. setResolvedModule(
  6465. originModule: Module,
  6466. dependency: Dependency,
  6467. module: Module
  6468. ): void;
  6469. updateModule(dependency: Dependency, module: Module): void;
  6470. removeConnection(dependency: Dependency): void;
  6471. addExplanation(dependency: Dependency, explanation: string): void;
  6472. cloneModuleAttributes(sourceModule: Module, targetModule: Module): void;
  6473. removeModuleAttributes(module: Module): void;
  6474. removeAllModuleAttributes(): void;
  6475. moveModuleConnections(
  6476. oldModule: Module,
  6477. newModule: Module,
  6478. filterConnection: (arg0: ModuleGraphConnection) => boolean
  6479. ): void;
  6480. copyOutgoingModuleConnections(
  6481. oldModule: Module,
  6482. newModule: Module,
  6483. filterConnection: (arg0: ModuleGraphConnection) => boolean
  6484. ): void;
  6485. addExtraReason(module: Module, explanation: string): void;
  6486. getResolvedModule(dependency: Dependency): Module;
  6487. getConnection(dependency: Dependency): undefined | ModuleGraphConnection;
  6488. getModule(dependency: Dependency): Module;
  6489. getOrigin(dependency: Dependency): Module;
  6490. getResolvedOrigin(dependency: Dependency): Module;
  6491. getIncomingConnections(module: Module): Iterable<ModuleGraphConnection>;
  6492. getOutgoingConnections(module: Module): Iterable<ModuleGraphConnection>;
  6493. getIncomingConnectionsByOriginModule(
  6494. module: Module
  6495. ): Map<undefined | Module, ReadonlyArray<ModuleGraphConnection>>;
  6496. getOutgoingConnectionsByModule(
  6497. module: Module
  6498. ): undefined | Map<undefined | Module, ReadonlyArray<ModuleGraphConnection>>;
  6499. getProfile(module: Module): null | ModuleProfile;
  6500. setProfile(module: Module, profile: null | ModuleProfile): void;
  6501. getIssuer(module: Module): null | Module;
  6502. setIssuer(module: Module, issuer: null | Module): void;
  6503. setIssuerIfUnset(module: Module, issuer: null | Module): void;
  6504. getOptimizationBailout(
  6505. module: Module
  6506. ): (string | ((requestShortener: RequestShortener) => string))[];
  6507. getProvidedExports(module: Module): null | true | string[];
  6508. isExportProvided(
  6509. module: Module,
  6510. exportName: string | string[]
  6511. ): null | boolean;
  6512. getExportsInfo(module: Module): ExportsInfo;
  6513. getExportInfo(module: Module, exportName: string): ExportInfo;
  6514. getReadOnlyExportInfo(module: Module, exportName: string): ExportInfo;
  6515. getUsedExports(
  6516. module: Module,
  6517. runtime: RuntimeSpec
  6518. ): null | boolean | SortableSet<string>;
  6519. getPreOrderIndex(module: Module): number;
  6520. getPostOrderIndex(module: Module): number;
  6521. setPreOrderIndex(module: Module, index: number): void;
  6522. setPreOrderIndexIfUnset(module: Module, index: number): boolean;
  6523. setPostOrderIndex(module: Module, index: number): void;
  6524. setPostOrderIndexIfUnset(module: Module, index: number): boolean;
  6525. getDepth(module: Module): number;
  6526. setDepth(module: Module, depth: number): void;
  6527. setDepthIfLower(module: Module, depth: number): boolean;
  6528. isAsync(module: Module): boolean;
  6529. setAsync(module: Module): void;
  6530. getMeta(thing?: any): Object;
  6531. getMetaIfExisting(thing?: any): Object;
  6532. freeze(cacheStage?: string): void;
  6533. unfreeze(): void;
  6534. cached<T extends any[], V>(
  6535. fn: (moduleGraph: ModuleGraph, ...args: T) => V,
  6536. ...args: T
  6537. ): V;
  6538. setModuleMemCaches(
  6539. moduleMemCaches: Map<Module, WeakTupleMap<any, any>>
  6540. ): void;
  6541. dependencyCacheProvide(dependency: Dependency, ...args: any[]): any;
  6542. static getModuleGraphForModule(
  6543. module: Module,
  6544. deprecateMessage: string,
  6545. deprecationCode: string
  6546. ): ModuleGraph;
  6547. static setModuleGraphForModule(
  6548. module: Module,
  6549. moduleGraph: ModuleGraph
  6550. ): void;
  6551. static clearModuleGraphForModule(module: Module): void;
  6552. static ModuleGraphConnection: typeof ModuleGraphConnection;
  6553. }
  6554. declare class ModuleGraphConnection {
  6555. constructor(
  6556. originModule: null | Module,
  6557. dependency: null | Dependency,
  6558. module: Module,
  6559. explanation?: string,
  6560. weak?: boolean,
  6561. condition?:
  6562. | false
  6563. | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState)
  6564. );
  6565. originModule: null | Module;
  6566. resolvedOriginModule: null | Module;
  6567. dependency: null | Dependency;
  6568. resolvedModule: Module;
  6569. module: Module;
  6570. weak: boolean;
  6571. conditional: boolean;
  6572. condition: (
  6573. arg0: ModuleGraphConnection,
  6574. arg1: RuntimeSpec
  6575. ) => ConnectionState;
  6576. explanations: Set<string>;
  6577. clone(): ModuleGraphConnection;
  6578. addCondition(
  6579. condition: (
  6580. arg0: ModuleGraphConnection,
  6581. arg1: RuntimeSpec
  6582. ) => ConnectionState
  6583. ): void;
  6584. addExplanation(explanation: string): void;
  6585. readonly explanation: string;
  6586. active: void;
  6587. isActive(runtime: RuntimeSpec): boolean;
  6588. isTargetActive(runtime: RuntimeSpec): boolean;
  6589. getActiveState(runtime: RuntimeSpec): ConnectionState;
  6590. setActive(value: boolean): void;
  6591. static addConnectionStates: (
  6592. a: ConnectionState,
  6593. b: ConnectionState
  6594. ) => ConnectionState;
  6595. static TRANSITIVE_ONLY: typeof TRANSITIVE_ONLY;
  6596. static CIRCULAR_CONNECTION: typeof CIRCULAR_CONNECTION;
  6597. }
  6598. type ModuleInfo = ConcatenatedModuleInfo | ExternalModuleInfo;
  6599. /**
  6600. * Options affecting the normal modules (`NormalModuleFactory`).
  6601. */
  6602. declare interface ModuleOptions {
  6603. /**
  6604. * An array of rules applied by default for modules.
  6605. */
  6606. defaultRules?: (RuleSetRule | "...")[];
  6607. /**
  6608. * Enable warnings for full dynamic dependencies.
  6609. */
  6610. exprContextCritical?: boolean;
  6611. /**
  6612. * Enable recursive directory lookup for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRecursive'.
  6613. */
  6614. exprContextRecursive?: boolean;
  6615. /**
  6616. * Sets the default regular expression for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRegExp'.
  6617. */
  6618. exprContextRegExp?: boolean | RegExp;
  6619. /**
  6620. * Set the default request for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRequest'.
  6621. */
  6622. exprContextRequest?: string;
  6623. /**
  6624. * Specify options for each generator.
  6625. */
  6626. generator?: GeneratorOptionsByModuleType;
  6627. /**
  6628. * Don't parse files matching. It's matched against the full resolved request.
  6629. */
  6630. noParse?: string | Function | RegExp | (string | Function | RegExp)[];
  6631. /**
  6632. * Specify options for each parser.
  6633. */
  6634. parser?: ParserOptionsByModuleType;
  6635. /**
  6636. * An array of rules applied for modules.
  6637. */
  6638. rules?: (RuleSetRule | "...")[];
  6639. /**
  6640. * Emit errors instead of warnings when imported names don't exist in imported module. Deprecated: This option has moved to 'module.parser.javascript.strictExportPresence'.
  6641. */
  6642. strictExportPresence?: boolean;
  6643. /**
  6644. * Handle the this context correctly according to the spec for namespace objects. Deprecated: This option has moved to 'module.parser.javascript.strictThisContextOnImports'.
  6645. */
  6646. strictThisContextOnImports?: boolean;
  6647. /**
  6648. * Enable warnings when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextCritical'.
  6649. */
  6650. unknownContextCritical?: boolean;
  6651. /**
  6652. * Enable recursive directory lookup when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextRecursive'.
  6653. */
  6654. unknownContextRecursive?: boolean;
  6655. /**
  6656. * Sets the regular expression when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextRegExp'.
  6657. */
  6658. unknownContextRegExp?: boolean | RegExp;
  6659. /**
  6660. * Sets the request when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextRequest'.
  6661. */
  6662. unknownContextRequest?: string;
  6663. /**
  6664. * Cache the resolving of module requests.
  6665. */
  6666. unsafeCache?: boolean | Function;
  6667. /**
  6668. * Enable warnings for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextCritical'.
  6669. */
  6670. wrappedContextCritical?: boolean;
  6671. /**
  6672. * Enable recursive directory lookup for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRecursive'.
  6673. */
  6674. wrappedContextRecursive?: boolean;
  6675. /**
  6676. * Set the inner regular expression for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRegExp'.
  6677. */
  6678. wrappedContextRegExp?: RegExp;
  6679. }
  6680. /**
  6681. * Options affecting the normal modules (`NormalModuleFactory`).
  6682. */
  6683. declare interface ModuleOptionsNormalized {
  6684. /**
  6685. * An array of rules applied by default for modules.
  6686. */
  6687. defaultRules: (RuleSetRule | "...")[];
  6688. /**
  6689. * Specify options for each generator.
  6690. */
  6691. generator: GeneratorOptionsByModuleType;
  6692. /**
  6693. * Don't parse files matching. It's matched against the full resolved request.
  6694. */
  6695. noParse?: string | Function | RegExp | (string | Function | RegExp)[];
  6696. /**
  6697. * Specify options for each parser.
  6698. */
  6699. parser: ParserOptionsByModuleType;
  6700. /**
  6701. * An array of rules applied for modules.
  6702. */
  6703. rules: (RuleSetRule | "...")[];
  6704. /**
  6705. * Cache the resolving of module requests.
  6706. */
  6707. unsafeCache?: boolean | Function;
  6708. }
  6709. declare interface ModulePathData {
  6710. id: string | number;
  6711. hash: string;
  6712. hashWithLength?: (arg0: number) => string;
  6713. }
  6714. declare abstract class ModuleProfile {
  6715. startTime: number;
  6716. factoryStartTime: number;
  6717. factoryEndTime: number;
  6718. factory: number;
  6719. factoryParallelismFactor: number;
  6720. restoringStartTime: number;
  6721. restoringEndTime: number;
  6722. restoring: number;
  6723. restoringParallelismFactor: number;
  6724. integrationStartTime: number;
  6725. integrationEndTime: number;
  6726. integration: number;
  6727. integrationParallelismFactor: number;
  6728. buildingStartTime: number;
  6729. buildingEndTime: number;
  6730. building: number;
  6731. buildingParallelismFactor: number;
  6732. storingStartTime: number;
  6733. storingEndTime: number;
  6734. storing: number;
  6735. storingParallelismFactor: number;
  6736. additionalFactoryTimes: any;
  6737. additionalFactories: number;
  6738. additionalFactoriesParallelismFactor: number;
  6739. additionalIntegration: number;
  6740. markFactoryStart(): void;
  6741. markFactoryEnd(): void;
  6742. markRestoringStart(): void;
  6743. markRestoringEnd(): void;
  6744. markIntegrationStart(): void;
  6745. markIntegrationEnd(): void;
  6746. markBuildingStart(): void;
  6747. markBuildingEnd(): void;
  6748. markStoringStart(): void;
  6749. markStoringEnd(): void;
  6750. /**
  6751. * Merge this profile into another one
  6752. */
  6753. mergeInto(realProfile: ModuleProfile): void;
  6754. }
  6755. declare interface ModuleReferenceOptions {
  6756. /**
  6757. * the properties/exports of the module
  6758. */
  6759. ids: string[];
  6760. /**
  6761. * true, when this referenced export is called
  6762. */
  6763. call: boolean;
  6764. /**
  6765. * true, when this referenced export is directly imported (not via property access)
  6766. */
  6767. directImport: boolean;
  6768. /**
  6769. * if the position is ASI safe or unknown
  6770. */
  6771. asiSafe?: boolean;
  6772. }
  6773. declare interface ModuleSettings {
  6774. /**
  6775. * Specifies the layer in which the module should be placed in.
  6776. */
  6777. layer?: string;
  6778. /**
  6779. * Module type to use for the module.
  6780. */
  6781. type?: string;
  6782. /**
  6783. * Options for the resolver.
  6784. */
  6785. resolve?: ResolveOptionsWebpackOptions;
  6786. /**
  6787. * Options for parsing.
  6788. */
  6789. parser?: { [index: string]: any };
  6790. /**
  6791. * The options for the module generator.
  6792. */
  6793. generator?: { [index: string]: any };
  6794. /**
  6795. * Flags a module as with or without side effects.
  6796. */
  6797. sideEffects?: boolean;
  6798. }
  6799. declare abstract class ModuleTemplate {
  6800. type: string;
  6801. hooks: Readonly<{
  6802. content: { tap: (options?: any, fn?: any) => void };
  6803. module: { tap: (options?: any, fn?: any) => void };
  6804. render: { tap: (options?: any, fn?: any) => void };
  6805. package: { tap: (options?: any, fn?: any) => void };
  6806. hash: { tap: (options?: any, fn?: any) => void };
  6807. }>;
  6808. readonly runtimeTemplate: any;
  6809. }
  6810. declare class MultiCompiler {
  6811. constructor(
  6812. compilers: Compiler[] | Record<string, Compiler>,
  6813. options: MultiCompilerOptions
  6814. );
  6815. hooks: Readonly<{
  6816. done: SyncHook<[MultiStats]>;
  6817. invalid: MultiHook<SyncHook<[null | string, number]>>;
  6818. run: MultiHook<AsyncSeriesHook<[Compiler]>>;
  6819. watchClose: SyncHook<[]>;
  6820. watchRun: MultiHook<AsyncSeriesHook<[Compiler]>>;
  6821. infrastructureLog: MultiHook<SyncBailHook<[string, string, any[]], true>>;
  6822. }>;
  6823. compilers: Compiler[];
  6824. dependencies: WeakMap<Compiler, string[]>;
  6825. running: boolean;
  6826. readonly options: WebpackOptionsNormalized[] & MultiCompilerOptions;
  6827. readonly outputPath: string;
  6828. inputFileSystem: InputFileSystem;
  6829. outputFileSystem: OutputFileSystem;
  6830. watchFileSystem: WatchFileSystem;
  6831. intermediateFileSystem: IntermediateFileSystem;
  6832. getInfrastructureLogger(name?: any): WebpackLogger;
  6833. setDependencies(compiler: Compiler, dependencies: string[]): void;
  6834. validateDependencies(callback: CallbackFunction<MultiStats>): boolean;
  6835. runWithDependencies(
  6836. compilers: Compiler[],
  6837. fn: (compiler: Compiler, callback: CallbackFunction<MultiStats>) => any,
  6838. callback: CallbackFunction<MultiStats>
  6839. ): void;
  6840. watch(
  6841. watchOptions: WatchOptions | WatchOptions[],
  6842. handler: CallbackFunction<MultiStats>
  6843. ): MultiWatching;
  6844. run(callback: CallbackFunction<MultiStats>): void;
  6845. purgeInputFileSystem(): void;
  6846. close(callback: CallbackFunction<void>): void;
  6847. }
  6848. declare interface MultiCompilerOptions {
  6849. /**
  6850. * how many Compilers are allows to run at the same time in parallel
  6851. */
  6852. parallelism?: number;
  6853. }
  6854. declare abstract class MultiStats {
  6855. stats: Stats[];
  6856. readonly hash: string;
  6857. hasErrors(): boolean;
  6858. hasWarnings(): boolean;
  6859. toJson(options?: any): StatsCompilation;
  6860. toString(options?: any): string;
  6861. }
  6862. declare abstract class MultiWatching {
  6863. watchings: Watching[];
  6864. compiler: MultiCompiler;
  6865. invalidate(callback?: any): void;
  6866. suspend(): void;
  6867. resume(): void;
  6868. close(callback: CallbackFunction<void>): void;
  6869. }
  6870. declare class NamedChunkIdsPlugin {
  6871. constructor(options?: any);
  6872. delimiter: any;
  6873. context: any;
  6874. /**
  6875. * Apply the plugin
  6876. */
  6877. apply(compiler: Compiler): void;
  6878. }
  6879. declare class NamedModuleIdsPlugin {
  6880. constructor(options?: any);
  6881. options: any;
  6882. /**
  6883. * Apply the plugin
  6884. */
  6885. apply(compiler: Compiler): void;
  6886. }
  6887. declare class NaturalModuleIdsPlugin {
  6888. constructor();
  6889. /**
  6890. * Apply the plugin
  6891. */
  6892. apply(compiler: Compiler): void;
  6893. }
  6894. declare interface NeedBuildContext {
  6895. compilation: Compilation;
  6896. fileSystemInfo: FileSystemInfo;
  6897. valueCacheVersions: Map<string, string | Set<string>>;
  6898. }
  6899. declare class NoEmitOnErrorsPlugin {
  6900. constructor();
  6901. /**
  6902. * Apply the plugin
  6903. */
  6904. apply(compiler: Compiler): void;
  6905. }
  6906. declare class NodeEnvironmentPlugin {
  6907. constructor(options: {
  6908. /**
  6909. * infrastructure logging options
  6910. */
  6911. infrastructureLogging: InfrastructureLogging;
  6912. });
  6913. options: {
  6914. /**
  6915. * infrastructure logging options
  6916. */
  6917. infrastructureLogging: InfrastructureLogging;
  6918. };
  6919. /**
  6920. * Apply the plugin
  6921. */
  6922. apply(compiler: Compiler): void;
  6923. }
  6924. type NodeEstreeIndex =
  6925. | UnaryExpression
  6926. | ThisExpression
  6927. | ArrayExpression
  6928. | ObjectExpression
  6929. | FunctionExpression
  6930. | ArrowFunctionExpression
  6931. | YieldExpression
  6932. | SimpleLiteral
  6933. | RegExpLiteral
  6934. | BigIntLiteral
  6935. | UpdateExpression
  6936. | BinaryExpression
  6937. | AssignmentExpression
  6938. | LogicalExpression
  6939. | MemberExpression
  6940. | ConditionalExpression
  6941. | SimpleCallExpression
  6942. | NewExpression
  6943. | SequenceExpression
  6944. | TemplateLiteral
  6945. | TaggedTemplateExpression
  6946. | ClassExpression
  6947. | MetaProperty
  6948. | Identifier
  6949. | AwaitExpression
  6950. | ImportExpression
  6951. | ChainExpression
  6952. | FunctionDeclaration
  6953. | VariableDeclaration
  6954. | ClassDeclaration
  6955. | PrivateIdentifier
  6956. | ExpressionStatement
  6957. | BlockStatement
  6958. | StaticBlock
  6959. | EmptyStatement
  6960. | DebuggerStatement
  6961. | WithStatement
  6962. | ReturnStatement
  6963. | LabeledStatement
  6964. | BreakStatement
  6965. | ContinueStatement
  6966. | IfStatement
  6967. | SwitchStatement
  6968. | ThrowStatement
  6969. | TryStatement
  6970. | WhileStatement
  6971. | DoWhileStatement
  6972. | ForStatement
  6973. | ForInStatement
  6974. | ForOfStatement
  6975. | ImportDeclaration
  6976. | ExportNamedDeclaration
  6977. | ExportDefaultDeclaration
  6978. | ExportAllDeclaration
  6979. | MethodDefinition
  6980. | PropertyDefinition
  6981. | VariableDeclarator
  6982. | Program
  6983. | SwitchCase
  6984. | CatchClause
  6985. | Property
  6986. | AssignmentProperty
  6987. | Super
  6988. | TemplateElement
  6989. | SpreadElement
  6990. | ObjectPattern
  6991. | ArrayPattern
  6992. | RestElement
  6993. | AssignmentPattern
  6994. | ClassBody
  6995. | ImportSpecifier
  6996. | ImportDefaultSpecifier
  6997. | ImportNamespaceSpecifier
  6998. | ExportSpecifier;
  6999. /**
  7000. * Options object for node compatibility features.
  7001. */
  7002. declare interface NodeOptions {
  7003. /**
  7004. * Include a polyfill for the '__dirname' variable.
  7005. */
  7006. __dirname?: boolean | "warn-mock" | "mock" | "eval-only";
  7007. /**
  7008. * Include a polyfill for the '__filename' variable.
  7009. */
  7010. __filename?: boolean | "warn-mock" | "mock" | "eval-only";
  7011. /**
  7012. * Include a polyfill for the 'global' variable.
  7013. */
  7014. global?: boolean | "warn";
  7015. }
  7016. declare class NodeSourcePlugin {
  7017. constructor();
  7018. /**
  7019. * Apply the plugin
  7020. */
  7021. apply(compiler: Compiler): void;
  7022. }
  7023. declare class NodeTargetPlugin {
  7024. constructor();
  7025. /**
  7026. * Apply the plugin
  7027. */
  7028. apply(compiler: Compiler): void;
  7029. }
  7030. declare class NodeTemplatePlugin {
  7031. constructor(options?: any);
  7032. /**
  7033. * Apply the plugin
  7034. */
  7035. apply(compiler: Compiler): void;
  7036. }
  7037. type NodeWebpackOptions = false | NodeOptions;
  7038. declare class NormalModule extends Module {
  7039. constructor(__0: NormalModuleCreateData);
  7040. request: string;
  7041. userRequest: string;
  7042. rawRequest: string;
  7043. binary: boolean;
  7044. parser: Parser;
  7045. parserOptions?: Record<string, any>;
  7046. generator: Generator;
  7047. generatorOptions?: Record<string, any>;
  7048. resource: string;
  7049. resourceResolveData?: Record<string, any>;
  7050. matchResource?: string;
  7051. loaders: LoaderItem[];
  7052. error?: null | WebpackError;
  7053. restoreFromUnsafeCache(
  7054. unsafeCacheData?: any,
  7055. normalModuleFactory?: any
  7056. ): void;
  7057. createSourceForAsset(
  7058. context: string,
  7059. name: string,
  7060. content: string,
  7061. sourceMap?: any,
  7062. associatedObjectForCache?: Object
  7063. ): Source;
  7064. getCurrentLoader(loaderContext?: any, index?: any): null | LoaderItem;
  7065. createSource(
  7066. context: string,
  7067. content: string | Buffer,
  7068. sourceMap?: any,
  7069. associatedObjectForCache?: Object
  7070. ): Source;
  7071. markModuleAsErrored(error: WebpackError): void;
  7072. applyNoParseRule(rule?: any, content?: any): any;
  7073. shouldPreventParsing(noParseRule?: any, request?: any): any;
  7074. static getCompilationHooks(
  7075. compilation: Compilation
  7076. ): NormalModuleCompilationHooks;
  7077. static deserialize(context?: any): NormalModule;
  7078. }
  7079. declare interface NormalModuleCompilationHooks {
  7080. loader: SyncHook<[object, NormalModule]>;
  7081. beforeLoaders: SyncHook<[LoaderItem[], NormalModule, object]>;
  7082. beforeParse: SyncHook<[NormalModule]>;
  7083. beforeSnapshot: SyncHook<[NormalModule]>;
  7084. readResourceForScheme: HookMap<
  7085. AsyncSeriesBailHook<[string, NormalModule], string | Buffer>
  7086. >;
  7087. readResource: HookMap<AsyncSeriesBailHook<[object], string | Buffer>>;
  7088. needBuild: AsyncSeriesBailHook<[NormalModule, NeedBuildContext], boolean>;
  7089. }
  7090. declare interface NormalModuleCreateData {
  7091. /**
  7092. * an optional layer in which the module is
  7093. */
  7094. layer?: string;
  7095. /**
  7096. * module type
  7097. */
  7098. type: string;
  7099. /**
  7100. * request string
  7101. */
  7102. request: string;
  7103. /**
  7104. * request intended by user (without loaders from config)
  7105. */
  7106. userRequest: string;
  7107. /**
  7108. * request without resolving
  7109. */
  7110. rawRequest: string;
  7111. /**
  7112. * list of loaders
  7113. */
  7114. loaders: LoaderItem[];
  7115. /**
  7116. * path + query of the real resource
  7117. */
  7118. resource: string;
  7119. /**
  7120. * resource resolve data
  7121. */
  7122. resourceResolveData?: Record<string, any>;
  7123. /**
  7124. * context directory for resolving
  7125. */
  7126. context: string;
  7127. /**
  7128. * path + query of the matched resource (virtual)
  7129. */
  7130. matchResource?: string;
  7131. /**
  7132. * the parser used
  7133. */
  7134. parser: Parser;
  7135. /**
  7136. * the options of the parser used
  7137. */
  7138. parserOptions?: Record<string, any>;
  7139. /**
  7140. * the generator used
  7141. */
  7142. generator: Generator;
  7143. /**
  7144. * the options of the generator used
  7145. */
  7146. generatorOptions?: Record<string, any>;
  7147. /**
  7148. * options used for resolving requests from this module
  7149. */
  7150. resolveOptions?: ResolveOptionsWebpackOptions;
  7151. }
  7152. declare abstract class NormalModuleFactory extends ModuleFactory {
  7153. hooks: Readonly<{
  7154. resolve: AsyncSeriesBailHook<[ResolveData], false | void | Module>;
  7155. resolveForScheme: HookMap<
  7156. AsyncSeriesBailHook<[ResourceDataWithData, ResolveData], true | void>
  7157. >;
  7158. resolveInScheme: HookMap<
  7159. AsyncSeriesBailHook<[ResourceDataWithData, ResolveData], true | void>
  7160. >;
  7161. factorize: AsyncSeriesBailHook<[ResolveData], Module>;
  7162. beforeResolve: AsyncSeriesBailHook<[ResolveData], false | void>;
  7163. afterResolve: AsyncSeriesBailHook<[ResolveData], false | void>;
  7164. createModule: AsyncSeriesBailHook<
  7165. [
  7166. Partial<NormalModuleCreateData & { settings: ModuleSettings }>,
  7167. ResolveData
  7168. ],
  7169. void | Module
  7170. >;
  7171. module: SyncWaterfallHook<
  7172. [
  7173. Module,
  7174. Partial<NormalModuleCreateData & { settings: ModuleSettings }>,
  7175. ResolveData
  7176. ],
  7177. Module
  7178. >;
  7179. createParser: HookMap<SyncBailHook<any, any>>;
  7180. parser: HookMap<SyncHook<any>>;
  7181. createGenerator: HookMap<SyncBailHook<any, any>>;
  7182. generator: HookMap<SyncHook<any>>;
  7183. }>;
  7184. resolverFactory: ResolverFactory;
  7185. ruleSet: RuleSet;
  7186. context: string;
  7187. fs: InputFileSystem;
  7188. parserCache: Map<string, WeakMap<Object, any>>;
  7189. generatorCache: Map<string, WeakMap<Object, Generator>>;
  7190. cleanupForCache(): void;
  7191. resolveResource(
  7192. contextInfo?: any,
  7193. context?: any,
  7194. unresolvedResource?: any,
  7195. resolver?: any,
  7196. resolveContext?: any,
  7197. callback?: any
  7198. ): void;
  7199. resolveRequestArray(
  7200. contextInfo?: any,
  7201. context?: any,
  7202. array?: any,
  7203. resolver?: any,
  7204. resolveContext?: any,
  7205. callback?: any
  7206. ): any;
  7207. getParser(type?: any, parserOptions?: object): any;
  7208. createParser(type: string, parserOptions?: { [index: string]: any }): Parser;
  7209. getGenerator(type?: any, generatorOptions?: object): undefined | Generator;
  7210. createGenerator(type?: any, generatorOptions?: object): any;
  7211. getResolver(type?: any, resolveOptions?: any): ResolverWithOptions;
  7212. }
  7213. /**
  7214. * These properties are added by the NormalModule
  7215. */
  7216. declare interface NormalModuleLoaderContext<OptionsType> {
  7217. version: number;
  7218. getOptions(): OptionsType;
  7219. getOptions(schema: Parameters<typeof validateFunction>[0]): OptionsType;
  7220. emitWarning(warning: Error): void;
  7221. emitError(error: Error): void;
  7222. getLogger(name?: string): WebpackLogger;
  7223. resolve(
  7224. context: string,
  7225. request: string,
  7226. callback: (
  7227. arg0: null | Error,
  7228. arg1?: string | false,
  7229. arg2?: ResolveRequest
  7230. ) => void
  7231. ): any;
  7232. getResolve(options?: ResolveOptionsWithDependencyType): {
  7233. (
  7234. context: string,
  7235. request: string,
  7236. callback: (
  7237. arg0: null | Error,
  7238. arg1?: string | false,
  7239. arg2?: ResolveRequest
  7240. ) => void
  7241. ): void;
  7242. (context: string, request: string): Promise<string>;
  7243. };
  7244. emitFile(
  7245. name: string,
  7246. content: string | Buffer,
  7247. sourceMap?: string,
  7248. assetInfo?: AssetInfo
  7249. ): void;
  7250. addBuildDependency(dep: string): void;
  7251. utils: {
  7252. absolutify: (context: string, request: string) => string;
  7253. contextify: (context: string, request: string) => string;
  7254. createHash: (algorithm?: string) => Hash;
  7255. };
  7256. rootContext: string;
  7257. fs: InputFileSystem;
  7258. sourceMap?: boolean;
  7259. mode: "none" | "development" | "production";
  7260. webpack?: boolean;
  7261. _module?: NormalModule;
  7262. _compilation?: Compilation;
  7263. _compiler?: Compiler;
  7264. }
  7265. declare class NormalModuleReplacementPlugin {
  7266. /**
  7267. * Create an instance of the plugin
  7268. */
  7269. constructor(
  7270. resourceRegExp: RegExp,
  7271. newResource: string | ((arg0?: any) => void)
  7272. );
  7273. resourceRegExp: RegExp;
  7274. newResource: string | ((arg0?: any) => void);
  7275. /**
  7276. * Apply the plugin
  7277. */
  7278. apply(compiler: Compiler): void;
  7279. }
  7280. type NormalizedStatsOptions = KnownNormalizedStatsOptions &
  7281. Omit<
  7282. StatsOptions,
  7283. | "context"
  7284. | "chunkGroups"
  7285. | "requestShortener"
  7286. | "chunksSort"
  7287. | "modulesSort"
  7288. | "chunkModulesSort"
  7289. | "nestedModulesSort"
  7290. | "assetsSort"
  7291. | "ids"
  7292. | "cachedAssets"
  7293. | "groupAssetsByEmitStatus"
  7294. | "groupAssetsByPath"
  7295. | "groupAssetsByExtension"
  7296. | "assetsSpace"
  7297. | "excludeAssets"
  7298. | "excludeModules"
  7299. | "warningsFilter"
  7300. | "cachedModules"
  7301. | "orphanModules"
  7302. | "dependentModules"
  7303. | "runtimeModules"
  7304. | "groupModulesByCacheStatus"
  7305. | "groupModulesByLayer"
  7306. | "groupModulesByAttributes"
  7307. | "groupModulesByPath"
  7308. | "groupModulesByExtension"
  7309. | "groupModulesByType"
  7310. | "entrypoints"
  7311. | "chunkGroupAuxiliary"
  7312. | "chunkGroupChildren"
  7313. | "chunkGroupMaxAssets"
  7314. | "modulesSpace"
  7315. | "chunkModulesSpace"
  7316. | "nestedModulesSpace"
  7317. | "logging"
  7318. | "loggingDebug"
  7319. | "loggingTrace"
  7320. | "_env"
  7321. > &
  7322. Record<string, any>;
  7323. declare class NullDependency extends Dependency {
  7324. constructor();
  7325. static Template: typeof NullDependencyTemplate;
  7326. static NO_EXPORTS_REFERENCED: string[][];
  7327. static EXPORTS_OBJECT_REFERENCED: string[][];
  7328. static TRANSITIVE: typeof TRANSITIVE;
  7329. }
  7330. declare class NullDependencyTemplate extends DependencyTemplate {
  7331. constructor();
  7332. }
  7333. declare interface ObjectDeserializerContext {
  7334. read: () => any;
  7335. }
  7336. declare interface ObjectSerializer {
  7337. serialize: (arg0: any, arg1: ObjectSerializerContext) => void;
  7338. deserialize: (arg0: ObjectDeserializerContext) => any;
  7339. }
  7340. declare interface ObjectSerializerContext {
  7341. write: (arg0?: any) => void;
  7342. }
  7343. declare class OccurrenceChunkIdsPlugin {
  7344. constructor(options?: OccurrenceChunkIdsPluginOptions);
  7345. options: OccurrenceChunkIdsPluginOptions;
  7346. /**
  7347. * Apply the plugin
  7348. */
  7349. apply(compiler: Compiler): void;
  7350. }
  7351. declare interface OccurrenceChunkIdsPluginOptions {
  7352. /**
  7353. * Prioritise initial size over total size.
  7354. */
  7355. prioritiseInitial?: boolean;
  7356. }
  7357. declare class OccurrenceModuleIdsPlugin {
  7358. constructor(options?: OccurrenceModuleIdsPluginOptions);
  7359. options: OccurrenceModuleIdsPluginOptions;
  7360. /**
  7361. * Apply the plugin
  7362. */
  7363. apply(compiler: Compiler): void;
  7364. }
  7365. declare interface OccurrenceModuleIdsPluginOptions {
  7366. /**
  7367. * Prioritise initial size over total size.
  7368. */
  7369. prioritiseInitial?: boolean;
  7370. }
  7371. /**
  7372. * Enables/Disables integrated optimizations.
  7373. */
  7374. declare interface Optimization {
  7375. /**
  7376. * Check for incompatible wasm types when importing/exporting from/to ESM.
  7377. */
  7378. checkWasmTypes?: boolean;
  7379. /**
  7380. * Define the algorithm to choose chunk ids (named: readable ids for better debugging, deterministic: numeric hash ids for better long term caching, size: numeric ids focused on minimal initial download size, total-size: numeric ids focused on minimal total download size, false: no algorithm used, as custom one can be provided via plugin).
  7381. */
  7382. chunkIds?:
  7383. | false
  7384. | "natural"
  7385. | "named"
  7386. | "deterministic"
  7387. | "size"
  7388. | "total-size";
  7389. /**
  7390. * Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer.
  7391. */
  7392. concatenateModules?: boolean;
  7393. /**
  7394. * Emit assets even when errors occur. Critical errors are emitted into the generated code and will cause errors at runtime.
  7395. */
  7396. emitOnErrors?: boolean;
  7397. /**
  7398. * Also flag chunks as loaded which contain a subset of the modules.
  7399. */
  7400. flagIncludedChunks?: boolean;
  7401. /**
  7402. * Creates a module-internal dependency graph for top level symbols, exports and imports, to improve unused exports detection.
  7403. */
  7404. innerGraph?: boolean;
  7405. /**
  7406. * Rename exports when possible to generate shorter code (depends on optimization.usedExports and optimization.providedExports, true/"deterministic": generate short deterministic names optimized for caching, "size": generate the shortest possible names).
  7407. */
  7408. mangleExports?: boolean | "deterministic" | "size";
  7409. /**
  7410. * Reduce size of WASM by changing imports to shorter strings.
  7411. */
  7412. mangleWasmImports?: boolean;
  7413. /**
  7414. * Merge chunks which contain the same modules.
  7415. */
  7416. mergeDuplicateChunks?: boolean;
  7417. /**
  7418. * Enable minimizing the output. Uses optimization.minimizer.
  7419. */
  7420. minimize?: boolean;
  7421. /**
  7422. * Minimizer(s) to use for minimizing the output.
  7423. */
  7424. minimizer?: (
  7425. | ((this: Compiler, compiler: Compiler) => void)
  7426. | WebpackPluginInstance
  7427. | "..."
  7428. )[];
  7429. /**
  7430. * Define the algorithm to choose module ids (natural: numeric ids in order of usage, named: readable ids for better debugging, hashed: (deprecated) short hashes as ids for better long term caching, deterministic: numeric hash ids for better long term caching, size: numeric ids focused on minimal initial download size, false: no algorithm used, as custom one can be provided via plugin).
  7431. */
  7432. moduleIds?: false | "natural" | "named" | "deterministic" | "size" | "hashed";
  7433. /**
  7434. * Avoid emitting assets when errors occur (deprecated: use 'emitOnErrors' instead).
  7435. */
  7436. noEmitOnErrors?: boolean;
  7437. /**
  7438. * Set process.env.NODE_ENV to a specific value.
  7439. */
  7440. nodeEnv?: string | false;
  7441. /**
  7442. * Generate records with relative paths to be able to move the context folder.
  7443. */
  7444. portableRecords?: boolean;
  7445. /**
  7446. * Figure out which exports are provided by modules to generate more efficient code.
  7447. */
  7448. providedExports?: boolean;
  7449. /**
  7450. * Use real [contenthash] based on final content of the assets.
  7451. */
  7452. realContentHash?: boolean;
  7453. /**
  7454. * Removes modules from chunks when these modules are already included in all parents.
  7455. */
  7456. removeAvailableModules?: boolean;
  7457. /**
  7458. * Remove chunks which are empty.
  7459. */
  7460. removeEmptyChunks?: boolean;
  7461. /**
  7462. * Create an additional chunk which contains only the webpack runtime and chunk hash maps.
  7463. */
  7464. runtimeChunk?:
  7465. | boolean
  7466. | "single"
  7467. | "multiple"
  7468. | {
  7469. /**
  7470. * The name or name factory for the runtime chunks.
  7471. */
  7472. name?: string | Function;
  7473. };
  7474. /**
  7475. * Skip over modules which contain no side effects when exports are not used (false: disabled, 'flag': only use manually placed side effects flag, true: also analyse source code for side effects).
  7476. */
  7477. sideEffects?: boolean | "flag";
  7478. /**
  7479. * Optimize duplication and caching by splitting chunks by shared modules and cache group.
  7480. */
  7481. splitChunks?: false | OptimizationSplitChunksOptions;
  7482. /**
  7483. * Figure out which exports are used by modules to mangle export names, omit unused exports and generate more efficient code (true: analyse used exports for each runtime, "global": analyse exports globally for all runtimes combined).
  7484. */
  7485. usedExports?: boolean | "global";
  7486. }
  7487. /**
  7488. * Options object for describing behavior of a cache group selecting modules that should be cached together.
  7489. */
  7490. declare interface OptimizationSplitChunksCacheGroup {
  7491. /**
  7492. * Sets the name delimiter for created chunks.
  7493. */
  7494. automaticNameDelimiter?: string;
  7495. /**
  7496. * Select chunks for determining cache group content (defaults to "initial", "initial" and "all" requires adding these chunks to the HTML).
  7497. */
  7498. chunks?: "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
  7499. /**
  7500. * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group.
  7501. */
  7502. enforce?: boolean;
  7503. /**
  7504. * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
  7505. */
  7506. enforceSizeThreshold?: number | { [index: string]: number };
  7507. /**
  7508. * Sets the template for the filename for created chunks.
  7509. */
  7510. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  7511. /**
  7512. * Sets the hint for chunk id.
  7513. */
  7514. idHint?: string;
  7515. /**
  7516. * Assign modules to a cache group by module layer.
  7517. */
  7518. layer?: string | Function | RegExp;
  7519. /**
  7520. * Maximum number of requests which are accepted for on-demand loading.
  7521. */
  7522. maxAsyncRequests?: number;
  7523. /**
  7524. * Maximal size hint for the on-demand chunks.
  7525. */
  7526. maxAsyncSize?: number | { [index: string]: number };
  7527. /**
  7528. * Maximum number of initial chunks which are accepted for an entry point.
  7529. */
  7530. maxInitialRequests?: number;
  7531. /**
  7532. * Maximal size hint for the initial chunks.
  7533. */
  7534. maxInitialSize?: number | { [index: string]: number };
  7535. /**
  7536. * Maximal size hint for the created chunks.
  7537. */
  7538. maxSize?: number | { [index: string]: number };
  7539. /**
  7540. * Minimum number of times a module has to be duplicated until it's considered for splitting.
  7541. */
  7542. minChunks?: number;
  7543. /**
  7544. * Minimal size for the chunks the stay after moving the modules to a new chunk.
  7545. */
  7546. minRemainingSize?: number | { [index: string]: number };
  7547. /**
  7548. * Minimal size for the created chunk.
  7549. */
  7550. minSize?: number | { [index: string]: number };
  7551. /**
  7552. * Minimum size reduction due to the created chunk.
  7553. */
  7554. minSizeReduction?: number | { [index: string]: number };
  7555. /**
  7556. * Give chunks for this cache group a name (chunks with equal name are merged).
  7557. */
  7558. name?: string | false | Function;
  7559. /**
  7560. * Priority of this cache group.
  7561. */
  7562. priority?: number;
  7563. /**
  7564. * Try to reuse existing chunk (with name) when it has matching modules.
  7565. */
  7566. reuseExistingChunk?: boolean;
  7567. /**
  7568. * Assign modules to a cache group by module name.
  7569. */
  7570. test?: string | Function | RegExp;
  7571. /**
  7572. * Assign modules to a cache group by module type.
  7573. */
  7574. type?: string | Function | RegExp;
  7575. /**
  7576. * Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.
  7577. */
  7578. usedExports?: boolean;
  7579. }
  7580. /**
  7581. * Options object for splitting chunks into smaller chunks.
  7582. */
  7583. declare interface OptimizationSplitChunksOptions {
  7584. /**
  7585. * Sets the name delimiter for created chunks.
  7586. */
  7587. automaticNameDelimiter?: string;
  7588. /**
  7589. * Assign modules to a cache group (modules from different cache groups are tried to keep in separate chunks, default categories: 'default', 'defaultVendors').
  7590. */
  7591. cacheGroups?: {
  7592. [index: string]:
  7593. | string
  7594. | false
  7595. | Function
  7596. | RegExp
  7597. | OptimizationSplitChunksCacheGroup;
  7598. };
  7599. /**
  7600. * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
  7601. */
  7602. chunks?: "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
  7603. /**
  7604. * Sets the size types which are used when a number is used for sizes.
  7605. */
  7606. defaultSizeTypes?: string[];
  7607. /**
  7608. * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
  7609. */
  7610. enforceSizeThreshold?: number | { [index: string]: number };
  7611. /**
  7612. * Options for modules not selected by any other cache group.
  7613. */
  7614. fallbackCacheGroup?: {
  7615. /**
  7616. * Sets the name delimiter for created chunks.
  7617. */
  7618. automaticNameDelimiter?: string;
  7619. /**
  7620. * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
  7621. */
  7622. chunks?: "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
  7623. /**
  7624. * Maximal size hint for the on-demand chunks.
  7625. */
  7626. maxAsyncSize?: number | { [index: string]: number };
  7627. /**
  7628. * Maximal size hint for the initial chunks.
  7629. */
  7630. maxInitialSize?: number | { [index: string]: number };
  7631. /**
  7632. * Maximal size hint for the created chunks.
  7633. */
  7634. maxSize?: number | { [index: string]: number };
  7635. /**
  7636. * Minimal size for the created chunk.
  7637. */
  7638. minSize?: number | { [index: string]: number };
  7639. /**
  7640. * Minimum size reduction due to the created chunk.
  7641. */
  7642. minSizeReduction?: number | { [index: string]: number };
  7643. };
  7644. /**
  7645. * Sets the template for the filename for created chunks.
  7646. */
  7647. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  7648. /**
  7649. * Prevents exposing path info when creating names for parts splitted by maxSize.
  7650. */
  7651. hidePathInfo?: boolean;
  7652. /**
  7653. * Maximum number of requests which are accepted for on-demand loading.
  7654. */
  7655. maxAsyncRequests?: number;
  7656. /**
  7657. * Maximal size hint for the on-demand chunks.
  7658. */
  7659. maxAsyncSize?: number | { [index: string]: number };
  7660. /**
  7661. * Maximum number of initial chunks which are accepted for an entry point.
  7662. */
  7663. maxInitialRequests?: number;
  7664. /**
  7665. * Maximal size hint for the initial chunks.
  7666. */
  7667. maxInitialSize?: number | { [index: string]: number };
  7668. /**
  7669. * Maximal size hint for the created chunks.
  7670. */
  7671. maxSize?: number | { [index: string]: number };
  7672. /**
  7673. * Minimum number of times a module has to be duplicated until it's considered for splitting.
  7674. */
  7675. minChunks?: number;
  7676. /**
  7677. * Minimal size for the chunks the stay after moving the modules to a new chunk.
  7678. */
  7679. minRemainingSize?: number | { [index: string]: number };
  7680. /**
  7681. * Minimal size for the created chunks.
  7682. */
  7683. minSize?: number | { [index: string]: number };
  7684. /**
  7685. * Minimum size reduction due to the created chunk.
  7686. */
  7687. minSizeReduction?: number | { [index: string]: number };
  7688. /**
  7689. * Give chunks created a name (chunks with equal name are merged).
  7690. */
  7691. name?: string | false | Function;
  7692. /**
  7693. * Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.
  7694. */
  7695. usedExports?: boolean;
  7696. }
  7697. declare abstract class OptionsApply {
  7698. process(options?: any, compiler?: any): void;
  7699. }
  7700. declare interface OriginRecord {
  7701. module: Module;
  7702. loc: DependencyLocation;
  7703. request: string;
  7704. }
  7705. declare class OriginalSource extends Source {
  7706. constructor(source: string | Buffer, name: string);
  7707. getName(): string;
  7708. }
  7709. /**
  7710. * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  7711. */
  7712. declare interface Output {
  7713. /**
  7714. * The filename of asset modules as relative path inside the 'output.path' directory.
  7715. */
  7716. assetModuleFilename?:
  7717. | string
  7718. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  7719. /**
  7720. * Enable/disable creating async chunks that are loaded on demand.
  7721. */
  7722. asyncChunks?: boolean;
  7723. /**
  7724. * Add a comment in the UMD wrapper.
  7725. */
  7726. auxiliaryComment?: string | LibraryCustomUmdCommentObject;
  7727. /**
  7728. * Add charset attribute for script tag.
  7729. */
  7730. charset?: boolean;
  7731. /**
  7732. * Specifies the filename template of output files of non-initial chunks on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
  7733. */
  7734. chunkFilename?:
  7735. | string
  7736. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  7737. /**
  7738. * The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), 'module' (ESM), but others might be added by plugins).
  7739. */
  7740. chunkFormat?: string | false;
  7741. /**
  7742. * Number of milliseconds before chunk request expires.
  7743. */
  7744. chunkLoadTimeout?: number;
  7745. /**
  7746. * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
  7747. */
  7748. chunkLoading?: string | false;
  7749. /**
  7750. * The global variable used by webpack for loading of chunks.
  7751. */
  7752. chunkLoadingGlobal?: string;
  7753. /**
  7754. * Clean the output directory before emit.
  7755. */
  7756. clean?: boolean | CleanOptions;
  7757. /**
  7758. * Check if to be emitted file already exists and have the same content before writing to output filesystem.
  7759. */
  7760. compareBeforeEmit?: boolean;
  7761. /**
  7762. * This option enables cross-origin loading of chunks.
  7763. */
  7764. crossOriginLoading?: false | "anonymous" | "use-credentials";
  7765. /**
  7766. * Specifies the filename template of non-initial output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
  7767. */
  7768. cssChunkFilename?:
  7769. | string
  7770. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  7771. /**
  7772. * Specifies the filename template of output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
  7773. */
  7774. cssFilename?:
  7775. | string
  7776. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  7777. /**
  7778. * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
  7779. */
  7780. devtoolFallbackModuleFilenameTemplate?: string | Function;
  7781. /**
  7782. * Filename template string of function for the sources array in a generated SourceMap.
  7783. */
  7784. devtoolModuleFilenameTemplate?: string | Function;
  7785. /**
  7786. * Module namespace to use when interpolating filename template string for the sources array in a generated SourceMap. Defaults to `output.library` if not set. It's useful for avoiding runtime collisions in sourcemaps from multiple webpack projects built as libraries.
  7787. */
  7788. devtoolNamespace?: string;
  7789. /**
  7790. * List of chunk loading types enabled for use by entry points.
  7791. */
  7792. enabledChunkLoadingTypes?: string[];
  7793. /**
  7794. * List of library types enabled for use by entry points.
  7795. */
  7796. enabledLibraryTypes?: string[];
  7797. /**
  7798. * List of wasm loading types enabled for use by entry points.
  7799. */
  7800. enabledWasmLoadingTypes?: string[];
  7801. /**
  7802. * The abilities of the environment where the webpack generated code should run.
  7803. */
  7804. environment?: Environment;
  7805. /**
  7806. * Specifies the filename of output files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
  7807. */
  7808. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  7809. /**
  7810. * An expression which is used to address the global object/scope in runtime code.
  7811. */
  7812. globalObject?: string;
  7813. /**
  7814. * Digest type used for the hash.
  7815. */
  7816. hashDigest?: string;
  7817. /**
  7818. * Number of chars which are used for the hash.
  7819. */
  7820. hashDigestLength?: number;
  7821. /**
  7822. * Algorithm used for generation the hash (see node.js crypto package).
  7823. */
  7824. hashFunction?: string | typeof Hash;
  7825. /**
  7826. * Any string which is added to the hash to salt it.
  7827. */
  7828. hashSalt?: string;
  7829. /**
  7830. * The filename of the Hot Update Chunks. They are inside the output.path directory.
  7831. */
  7832. hotUpdateChunkFilename?: string;
  7833. /**
  7834. * The global variable used by webpack for loading of hot update chunks.
  7835. */
  7836. hotUpdateGlobal?: string;
  7837. /**
  7838. * The filename of the Hot Update Main File. It is inside the 'output.path' directory.
  7839. */
  7840. hotUpdateMainFilename?: string;
  7841. /**
  7842. * Wrap javascript code into IIFE's to avoid leaking into global scope.
  7843. */
  7844. iife?: boolean;
  7845. /**
  7846. * The name of the native import() function (can be exchanged for a polyfill).
  7847. */
  7848. importFunctionName?: string;
  7849. /**
  7850. * The name of the native import.meta object (can be exchanged for a polyfill).
  7851. */
  7852. importMetaName?: string;
  7853. /**
  7854. * Make the output files a library, exporting the exports of the entry point.
  7855. */
  7856. library?: string | string[] | LibraryOptions | LibraryCustomUmdObject;
  7857. /**
  7858. * Specify which export should be exposed as library.
  7859. */
  7860. libraryExport?: string | string[];
  7861. /**
  7862. * Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
  7863. */
  7864. libraryTarget?: string;
  7865. /**
  7866. * Output javascript files as module source type.
  7867. */
  7868. module?: boolean;
  7869. /**
  7870. * The output directory as **absolute path** (required).
  7871. */
  7872. path?: string;
  7873. /**
  7874. * Include comments with information about the modules.
  7875. */
  7876. pathinfo?: boolean | "verbose";
  7877. /**
  7878. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  7879. */
  7880. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  7881. /**
  7882. * This option enables loading async chunks via a custom script type, such as script type="module".
  7883. */
  7884. scriptType?: false | "module" | "text/javascript";
  7885. /**
  7886. * The filename of the SourceMaps for the JavaScript files. They are inside the 'output.path' directory.
  7887. */
  7888. sourceMapFilename?: string;
  7889. /**
  7890. * Prefixes every line of the source in the bundle with this string.
  7891. */
  7892. sourcePrefix?: string;
  7893. /**
  7894. * Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.
  7895. */
  7896. strictModuleErrorHandling?: boolean;
  7897. /**
  7898. * Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.
  7899. */
  7900. strictModuleExceptionHandling?: boolean;
  7901. /**
  7902. * Use a Trusted Types policy to create urls for chunks. 'output.uniqueName' is used a default policy name. Passing a string sets a custom policy name.
  7903. */
  7904. trustedTypes?: string | true | TrustedTypes;
  7905. /**
  7906. * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
  7907. */
  7908. umdNamedDefine?: boolean;
  7909. /**
  7910. * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.
  7911. */
  7912. uniqueName?: string;
  7913. /**
  7914. * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
  7915. */
  7916. wasmLoading?: string | false;
  7917. /**
  7918. * The filename of WebAssembly modules as relative path inside the 'output.path' directory.
  7919. */
  7920. webassemblyModuleFilename?: string;
  7921. /**
  7922. * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
  7923. */
  7924. workerChunkLoading?: string | false;
  7925. /**
  7926. * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
  7927. */
  7928. workerWasmLoading?: string | false;
  7929. }
  7930. declare interface OutputFileSystem {
  7931. writeFile: (
  7932. arg0: string,
  7933. arg1: string | Buffer,
  7934. arg2: (arg0?: null | NodeJS.ErrnoException) => void
  7935. ) => void;
  7936. mkdir: (
  7937. arg0: string,
  7938. arg1: (arg0?: null | NodeJS.ErrnoException) => void
  7939. ) => void;
  7940. readdir?: (
  7941. arg0: string,
  7942. arg1: (
  7943. arg0?: null | NodeJS.ErrnoException,
  7944. arg1?: (string | Buffer)[] | IDirent[]
  7945. ) => void
  7946. ) => void;
  7947. rmdir?: (
  7948. arg0: string,
  7949. arg1: (arg0?: null | NodeJS.ErrnoException) => void
  7950. ) => void;
  7951. unlink?: (
  7952. arg0: string,
  7953. arg1: (arg0?: null | NodeJS.ErrnoException) => void
  7954. ) => void;
  7955. stat: (
  7956. arg0: string,
  7957. arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: IStats) => void
  7958. ) => void;
  7959. lstat?: (
  7960. arg0: string,
  7961. arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: IStats) => void
  7962. ) => void;
  7963. readFile: (
  7964. arg0: string,
  7965. arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: string | Buffer) => void
  7966. ) => void;
  7967. join?: (arg0: string, arg1: string) => string;
  7968. relative?: (arg0: string, arg1: string) => string;
  7969. dirname?: (arg0: string) => string;
  7970. }
  7971. /**
  7972. * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  7973. */
  7974. declare interface OutputNormalized {
  7975. /**
  7976. * The filename of asset modules as relative path inside the 'output.path' directory.
  7977. */
  7978. assetModuleFilename?:
  7979. | string
  7980. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  7981. /**
  7982. * Enable/disable creating async chunks that are loaded on demand.
  7983. */
  7984. asyncChunks?: boolean;
  7985. /**
  7986. * Add charset attribute for script tag.
  7987. */
  7988. charset?: boolean;
  7989. /**
  7990. * Specifies the filename template of output files of non-initial chunks on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
  7991. */
  7992. chunkFilename?:
  7993. | string
  7994. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  7995. /**
  7996. * The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), 'module' (ESM), but others might be added by plugins).
  7997. */
  7998. chunkFormat?: string | false;
  7999. /**
  8000. * Number of milliseconds before chunk request expires.
  8001. */
  8002. chunkLoadTimeout?: number;
  8003. /**
  8004. * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
  8005. */
  8006. chunkLoading?: string | false;
  8007. /**
  8008. * The global variable used by webpack for loading of chunks.
  8009. */
  8010. chunkLoadingGlobal?: string;
  8011. /**
  8012. * Clean the output directory before emit.
  8013. */
  8014. clean?: boolean | CleanOptions;
  8015. /**
  8016. * Check if to be emitted file already exists and have the same content before writing to output filesystem.
  8017. */
  8018. compareBeforeEmit?: boolean;
  8019. /**
  8020. * This option enables cross-origin loading of chunks.
  8021. */
  8022. crossOriginLoading?: false | "anonymous" | "use-credentials";
  8023. /**
  8024. * Specifies the filename template of non-initial output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
  8025. */
  8026. cssChunkFilename?:
  8027. | string
  8028. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8029. /**
  8030. * Specifies the filename template of output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
  8031. */
  8032. cssFilename?:
  8033. | string
  8034. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8035. /**
  8036. * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
  8037. */
  8038. devtoolFallbackModuleFilenameTemplate?: string | Function;
  8039. /**
  8040. * Filename template string of function for the sources array in a generated SourceMap.
  8041. */
  8042. devtoolModuleFilenameTemplate?: string | Function;
  8043. /**
  8044. * Module namespace to use when interpolating filename template string for the sources array in a generated SourceMap. Defaults to `output.library` if not set. It's useful for avoiding runtime collisions in sourcemaps from multiple webpack projects built as libraries.
  8045. */
  8046. devtoolNamespace?: string;
  8047. /**
  8048. * List of chunk loading types enabled for use by entry points.
  8049. */
  8050. enabledChunkLoadingTypes?: string[];
  8051. /**
  8052. * List of library types enabled for use by entry points.
  8053. */
  8054. enabledLibraryTypes?: string[];
  8055. /**
  8056. * List of wasm loading types enabled for use by entry points.
  8057. */
  8058. enabledWasmLoadingTypes?: string[];
  8059. /**
  8060. * The abilities of the environment where the webpack generated code should run.
  8061. */
  8062. environment?: Environment;
  8063. /**
  8064. * Specifies the filename of output files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
  8065. */
  8066. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8067. /**
  8068. * An expression which is used to address the global object/scope in runtime code.
  8069. */
  8070. globalObject?: string;
  8071. /**
  8072. * Digest type used for the hash.
  8073. */
  8074. hashDigest?: string;
  8075. /**
  8076. * Number of chars which are used for the hash.
  8077. */
  8078. hashDigestLength?: number;
  8079. /**
  8080. * Algorithm used for generation the hash (see node.js crypto package).
  8081. */
  8082. hashFunction?: string | typeof Hash;
  8083. /**
  8084. * Any string which is added to the hash to salt it.
  8085. */
  8086. hashSalt?: string;
  8087. /**
  8088. * The filename of the Hot Update Chunks. They are inside the output.path directory.
  8089. */
  8090. hotUpdateChunkFilename?: string;
  8091. /**
  8092. * The global variable used by webpack for loading of hot update chunks.
  8093. */
  8094. hotUpdateGlobal?: string;
  8095. /**
  8096. * The filename of the Hot Update Main File. It is inside the 'output.path' directory.
  8097. */
  8098. hotUpdateMainFilename?: string;
  8099. /**
  8100. * Wrap javascript code into IIFE's to avoid leaking into global scope.
  8101. */
  8102. iife?: boolean;
  8103. /**
  8104. * The name of the native import() function (can be exchanged for a polyfill).
  8105. */
  8106. importFunctionName?: string;
  8107. /**
  8108. * The name of the native import.meta object (can be exchanged for a polyfill).
  8109. */
  8110. importMetaName?: string;
  8111. /**
  8112. * Options for library.
  8113. */
  8114. library?: LibraryOptions;
  8115. /**
  8116. * Output javascript files as module source type.
  8117. */
  8118. module?: boolean;
  8119. /**
  8120. * The output directory as **absolute path** (required).
  8121. */
  8122. path?: string;
  8123. /**
  8124. * Include comments with information about the modules.
  8125. */
  8126. pathinfo?: boolean | "verbose";
  8127. /**
  8128. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  8129. */
  8130. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8131. /**
  8132. * This option enables loading async chunks via a custom script type, such as script type="module".
  8133. */
  8134. scriptType?: false | "module" | "text/javascript";
  8135. /**
  8136. * The filename of the SourceMaps for the JavaScript files. They are inside the 'output.path' directory.
  8137. */
  8138. sourceMapFilename?: string;
  8139. /**
  8140. * Prefixes every line of the source in the bundle with this string.
  8141. */
  8142. sourcePrefix?: string;
  8143. /**
  8144. * Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.
  8145. */
  8146. strictModuleErrorHandling?: boolean;
  8147. /**
  8148. * Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.
  8149. */
  8150. strictModuleExceptionHandling?: boolean;
  8151. /**
  8152. * Use a Trusted Types policy to create urls for chunks.
  8153. */
  8154. trustedTypes?: TrustedTypes;
  8155. /**
  8156. * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.
  8157. */
  8158. uniqueName?: string;
  8159. /**
  8160. * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
  8161. */
  8162. wasmLoading?: string | false;
  8163. /**
  8164. * The filename of WebAssembly modules as relative path inside the 'output.path' directory.
  8165. */
  8166. webassemblyModuleFilename?: string;
  8167. /**
  8168. * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
  8169. */
  8170. workerChunkLoading?: string | false;
  8171. /**
  8172. * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
  8173. */
  8174. workerWasmLoading?: string | false;
  8175. }
  8176. declare interface ParameterizedComparator<TArg, T> {
  8177. (arg0: TArg): Comparator<T>;
  8178. }
  8179. declare interface ParsedIdentifier {
  8180. request: string;
  8181. query: string;
  8182. fragment: string;
  8183. directory: boolean;
  8184. module: boolean;
  8185. file: boolean;
  8186. internal: boolean;
  8187. }
  8188. declare class Parser {
  8189. constructor();
  8190. parse(
  8191. source: string | Buffer | PreparsedAst,
  8192. state: ParserState
  8193. ): ParserState;
  8194. }
  8195. type ParserOptionsByModuleType = ParserOptionsByModuleTypeKnown &
  8196. ParserOptionsByModuleTypeUnknown;
  8197. /**
  8198. * Specify options for each parser.
  8199. */
  8200. declare interface ParserOptionsByModuleTypeKnown {
  8201. /**
  8202. * Parser options for asset modules.
  8203. */
  8204. asset?: AssetParserOptions;
  8205. /**
  8206. * No parser options are supported for this module type.
  8207. */
  8208. "asset/inline"?: EmptyParserOptions;
  8209. /**
  8210. * No parser options are supported for this module type.
  8211. */
  8212. "asset/resource"?: EmptyParserOptions;
  8213. /**
  8214. * No parser options are supported for this module type.
  8215. */
  8216. "asset/source"?: EmptyParserOptions;
  8217. /**
  8218. * Parser options for javascript modules.
  8219. */
  8220. javascript?: JavascriptParserOptions;
  8221. /**
  8222. * Parser options for javascript modules.
  8223. */
  8224. "javascript/auto"?: JavascriptParserOptions;
  8225. /**
  8226. * Parser options for javascript modules.
  8227. */
  8228. "javascript/dynamic"?: JavascriptParserOptions;
  8229. /**
  8230. * Parser options for javascript modules.
  8231. */
  8232. "javascript/esm"?: JavascriptParserOptions;
  8233. }
  8234. /**
  8235. * Specify options for each parser.
  8236. */
  8237. declare interface ParserOptionsByModuleTypeUnknown {
  8238. [index: string]: { [index: string]: any };
  8239. }
  8240. type ParserState = Record<string, any> & ParserStateBase;
  8241. declare interface ParserStateBase {
  8242. source: string | Buffer;
  8243. current: NormalModule;
  8244. module: NormalModule;
  8245. compilation: Compilation;
  8246. options: { [index: string]: any };
  8247. }
  8248. declare interface PathData {
  8249. chunkGraph?: ChunkGraph;
  8250. hash?: string;
  8251. hashWithLength?: (arg0: number) => string;
  8252. chunk?: Chunk | ChunkPathData;
  8253. module?: Module | ModulePathData;
  8254. runtime?: RuntimeSpec;
  8255. filename?: string;
  8256. basename?: string;
  8257. query?: string;
  8258. contentHashType?: string;
  8259. contentHash?: string;
  8260. contentHashWithLength?: (arg0: number) => string;
  8261. noChunkHash?: boolean;
  8262. url?: string;
  8263. }
  8264. /**
  8265. * Configuration object for web performance recommendations.
  8266. */
  8267. declare interface PerformanceOptions {
  8268. /**
  8269. * Filter function to select assets that are checked.
  8270. */
  8271. assetFilter?: Function;
  8272. /**
  8273. * Sets the format of the hints: warnings, errors or nothing at all.
  8274. */
  8275. hints?: false | "error" | "warning";
  8276. /**
  8277. * File size limit (in bytes) when exceeded, that webpack will provide performance hints.
  8278. */
  8279. maxAssetSize?: number;
  8280. /**
  8281. * Total size of an entry point (in bytes).
  8282. */
  8283. maxEntrypointSize?: number;
  8284. }
  8285. declare interface PitchLoaderDefinitionFunction<
  8286. OptionsType = {},
  8287. ContextAdditions = {}
  8288. > {
  8289. (
  8290. this: NormalModuleLoaderContext<OptionsType> &
  8291. LoaderRunnerLoaderContext<OptionsType> &
  8292. LoaderPluginLoaderContext &
  8293. HotModuleReplacementPluginLoaderContext &
  8294. ContextAdditions,
  8295. remainingRequest: string,
  8296. previousRequest: string,
  8297. data: object
  8298. ): string | void | Buffer | Promise<string | Buffer>;
  8299. }
  8300. type Plugin =
  8301. | { apply: (arg0: Resolver) => void }
  8302. | ((this: Resolver, arg1: Resolver) => void);
  8303. declare interface PnpApiImpl {
  8304. resolveToUnqualified: (arg0: string, arg1: string, arg2: object) => string;
  8305. }
  8306. declare interface PossibleFileSystemError {
  8307. code?: string;
  8308. errno?: number;
  8309. path?: string;
  8310. syscall?: string;
  8311. }
  8312. declare class PrefetchPlugin {
  8313. constructor(context?: any, request?: any);
  8314. context: any;
  8315. request: any;
  8316. /**
  8317. * Apply the plugin
  8318. */
  8319. apply(compiler: Compiler): void;
  8320. }
  8321. declare class PrefixSource extends Source {
  8322. constructor(prefix: string, source: string | Source);
  8323. original(): Source;
  8324. getPrefix(): string;
  8325. }
  8326. declare interface PreparsedAst {
  8327. [index: string]: any;
  8328. }
  8329. declare interface PrintedElement {
  8330. element: string;
  8331. content: string;
  8332. }
  8333. declare interface Problem {
  8334. type: ProblemType;
  8335. path: string;
  8336. argument: string;
  8337. value?: any;
  8338. index?: number;
  8339. expected?: string;
  8340. }
  8341. type ProblemType =
  8342. | "unknown-argument"
  8343. | "unexpected-non-array-in-path"
  8344. | "unexpected-non-object-in-path"
  8345. | "multiple-values-unexpected"
  8346. | "invalid-value";
  8347. declare interface ProcessAssetsAdditionalOptions {
  8348. additionalAssets?: true | Function;
  8349. }
  8350. declare class Profiler {
  8351. constructor(inspector?: any);
  8352. session: any;
  8353. inspector: any;
  8354. hasSession(): boolean;
  8355. startProfiling(): Promise<void> | Promise<[any, any, any]>;
  8356. sendCommand(method?: any, params?: any): Promise<any>;
  8357. destroy(): Promise<void>;
  8358. stopProfiling(): Promise<{ profile: any }>;
  8359. }
  8360. declare class ProfilingPlugin {
  8361. constructor(options?: ProfilingPluginOptions);
  8362. outputPath: string;
  8363. apply(compiler?: any): void;
  8364. static Profiler: typeof Profiler;
  8365. }
  8366. declare interface ProfilingPluginOptions {
  8367. /**
  8368. * Path to the output file e.g. `path.resolve(__dirname, 'profiling/events.json')`. Defaults to `events.json`.
  8369. */
  8370. outputPath?: string;
  8371. }
  8372. declare class ProgressPlugin {
  8373. constructor(options?: ProgressPluginArgument);
  8374. profile?: null | boolean;
  8375. handler?: (percentage: number, msg: string, ...args: string[]) => void;
  8376. modulesCount?: number;
  8377. dependenciesCount?: number;
  8378. showEntries?: boolean;
  8379. showModules?: boolean;
  8380. showDependencies?: boolean;
  8381. showActiveModules?: boolean;
  8382. percentBy?: null | "modules" | "dependencies" | "entries";
  8383. apply(compiler: Compiler | MultiCompiler): void;
  8384. static getReporter(
  8385. compiler: Compiler
  8386. ): (p: number, ...args: string[]) => void;
  8387. static defaultOptions: {
  8388. profile: boolean;
  8389. modulesCount: number;
  8390. dependenciesCount: number;
  8391. modules: boolean;
  8392. dependencies: boolean;
  8393. activeModules: boolean;
  8394. entries: boolean;
  8395. };
  8396. }
  8397. type ProgressPluginArgument =
  8398. | ProgressPluginOptions
  8399. | ((percentage: number, msg: string, ...args: string[]) => void);
  8400. /**
  8401. * Options object for the ProgressPlugin.
  8402. */
  8403. declare interface ProgressPluginOptions {
  8404. /**
  8405. * Show active modules count and one active module in progress message.
  8406. */
  8407. activeModules?: boolean;
  8408. /**
  8409. * Show dependencies count in progress message.
  8410. */
  8411. dependencies?: boolean;
  8412. /**
  8413. * Minimum dependencies count to start with. For better progress calculation. Default: 10000.
  8414. */
  8415. dependenciesCount?: number;
  8416. /**
  8417. * Show entries count in progress message.
  8418. */
  8419. entries?: boolean;
  8420. /**
  8421. * Function that executes for every progress step.
  8422. */
  8423. handler?: (percentage: number, msg: string, ...args: string[]) => void;
  8424. /**
  8425. * Show modules count in progress message.
  8426. */
  8427. modules?: boolean;
  8428. /**
  8429. * Minimum modules count to start with. For better progress calculation. Default: 5000.
  8430. */
  8431. modulesCount?: number;
  8432. /**
  8433. * Collect percent algorithm. By default it calculates by a median from modules, entries and dependencies percent.
  8434. */
  8435. percentBy?: null | "modules" | "dependencies" | "entries";
  8436. /**
  8437. * Collect profile data for progress steps. Default: false.
  8438. */
  8439. profile?: null | boolean;
  8440. }
  8441. declare class ProvidePlugin {
  8442. constructor(definitions: Record<string, string | string[]>);
  8443. definitions: Record<string, string | string[]>;
  8444. /**
  8445. * Apply the plugin
  8446. */
  8447. apply(compiler: Compiler): void;
  8448. }
  8449. declare class ProvideSharedPlugin {
  8450. constructor(options: ProvideSharedPluginOptions);
  8451. /**
  8452. * Apply the plugin
  8453. */
  8454. apply(compiler: Compiler): void;
  8455. }
  8456. declare interface ProvideSharedPluginOptions {
  8457. /**
  8458. * Modules that should be provided as shared modules to the share scope. When provided, property name is used to match modules, otherwise this is automatically inferred from share key.
  8459. */
  8460. provides: Provides;
  8461. /**
  8462. * Share scope name used for all provided modules (defaults to 'default').
  8463. */
  8464. shareScope?: string;
  8465. }
  8466. type Provides = (string | ProvidesObject)[] | ProvidesObject;
  8467. /**
  8468. * Advanced configuration for modules that should be provided as shared modules to the share scope.
  8469. */
  8470. declare interface ProvidesConfig {
  8471. /**
  8472. * Include the provided module directly instead behind an async request. This allows to use this shared module in initial load too. All possible shared modules need to be eager too.
  8473. */
  8474. eager?: boolean;
  8475. /**
  8476. * Key in the share scope under which the shared modules should be stored.
  8477. */
  8478. shareKey?: string;
  8479. /**
  8480. * Share scope name.
  8481. */
  8482. shareScope?: string;
  8483. /**
  8484. * Version of the provided module. Will replace lower matching versions, but not higher.
  8485. */
  8486. version?: string | false;
  8487. }
  8488. /**
  8489. * Modules that should be provided as shared modules to the share scope. Property names are used as share keys.
  8490. */
  8491. declare interface ProvidesObject {
  8492. [index: string]: string | ProvidesConfig;
  8493. }
  8494. declare interface RawChunkGroupOptions {
  8495. preloadOrder?: number;
  8496. prefetchOrder?: number;
  8497. }
  8498. type RawLoaderDefinition<
  8499. OptionsType = {},
  8500. ContextAdditions = {}
  8501. > = RawLoaderDefinitionFunction<OptionsType, ContextAdditions> & {
  8502. raw: true;
  8503. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  8504. };
  8505. declare interface RawLoaderDefinitionFunction<
  8506. OptionsType = {},
  8507. ContextAdditions = {}
  8508. > {
  8509. (
  8510. this: NormalModuleLoaderContext<OptionsType> &
  8511. LoaderRunnerLoaderContext<OptionsType> &
  8512. LoaderPluginLoaderContext &
  8513. HotModuleReplacementPluginLoaderContext &
  8514. ContextAdditions,
  8515. content: Buffer,
  8516. sourceMap?: string | SourceMap,
  8517. additionalData?: AdditionalData
  8518. ): string | void | Buffer | Promise<string | Buffer>;
  8519. }
  8520. declare class RawSource extends Source {
  8521. constructor(source: string | Buffer, convertToString?: boolean);
  8522. isBuffer(): boolean;
  8523. }
  8524. declare class ReadFileCompileWasmPlugin {
  8525. constructor(options?: any);
  8526. options: any;
  8527. /**
  8528. * Apply the plugin
  8529. */
  8530. apply(compiler: Compiler): void;
  8531. }
  8532. declare class RealContentHashPlugin {
  8533. constructor(__0: { hashFunction: any; hashDigest: any });
  8534. /**
  8535. * Apply the plugin
  8536. */
  8537. apply(compiler: Compiler): void;
  8538. static getCompilationHooks(
  8539. compilation: Compilation
  8540. ): CompilationHooksRealContentHashPlugin;
  8541. }
  8542. declare interface RealDependencyLocation {
  8543. start: SourcePosition;
  8544. end?: SourcePosition;
  8545. index?: number;
  8546. }
  8547. type RecursiveArrayOrRecord<T> =
  8548. | { [index: string]: RecursiveArrayOrRecord<T> }
  8549. | RecursiveArrayOrRecord<T>[]
  8550. | T;
  8551. declare interface ReferencedExport {
  8552. /**
  8553. * name of the referenced export
  8554. */
  8555. name: string[];
  8556. /**
  8557. * when false, referenced export can not be mangled, defaults to true
  8558. */
  8559. canMangle?: boolean;
  8560. }
  8561. type Remotes = (string | RemotesObject)[] | RemotesObject;
  8562. /**
  8563. * Advanced configuration for container locations from which modules should be resolved and loaded at runtime.
  8564. */
  8565. declare interface RemotesConfig {
  8566. /**
  8567. * Container locations from which modules should be resolved and loaded at runtime.
  8568. */
  8569. external: string | string[];
  8570. /**
  8571. * The name of the share scope shared with this remote.
  8572. */
  8573. shareScope?: string;
  8574. }
  8575. /**
  8576. * Container locations from which modules should be resolved and loaded at runtime. Property names are used as request scopes.
  8577. */
  8578. declare interface RemotesObject {
  8579. [index: string]: string | RemotesConfig | string[];
  8580. }
  8581. declare interface RenderBootstrapContext {
  8582. /**
  8583. * the chunk
  8584. */
  8585. chunk: Chunk;
  8586. /**
  8587. * results of code generation
  8588. */
  8589. codeGenerationResults: CodeGenerationResults;
  8590. /**
  8591. * the runtime template
  8592. */
  8593. runtimeTemplate: RuntimeTemplate;
  8594. /**
  8595. * the module graph
  8596. */
  8597. moduleGraph: ModuleGraph;
  8598. /**
  8599. * the chunk graph
  8600. */
  8601. chunkGraph: ChunkGraph;
  8602. /**
  8603. * hash to be used for render call
  8604. */
  8605. hash: string;
  8606. }
  8607. declare interface RenderContext {
  8608. /**
  8609. * the chunk
  8610. */
  8611. chunk: Chunk;
  8612. /**
  8613. * the dependency templates
  8614. */
  8615. dependencyTemplates: DependencyTemplates;
  8616. /**
  8617. * the runtime template
  8618. */
  8619. runtimeTemplate: RuntimeTemplate;
  8620. /**
  8621. * the module graph
  8622. */
  8623. moduleGraph: ModuleGraph;
  8624. /**
  8625. * the chunk graph
  8626. */
  8627. chunkGraph: ChunkGraph;
  8628. /**
  8629. * results of code generation
  8630. */
  8631. codeGenerationResults: CodeGenerationResults;
  8632. /**
  8633. * rendering in strict context
  8634. */
  8635. strictMode: boolean;
  8636. }
  8637. type RenderManifestEntry =
  8638. | RenderManifestEntryTemplated
  8639. | RenderManifestEntryStatic;
  8640. declare interface RenderManifestEntryStatic {
  8641. render: () => Source;
  8642. filename: string;
  8643. info: AssetInfo;
  8644. identifier: string;
  8645. hash?: string;
  8646. auxiliary?: boolean;
  8647. }
  8648. declare interface RenderManifestEntryTemplated {
  8649. render: () => Source;
  8650. filenameTemplate: string | ((arg0: PathData, arg1?: AssetInfo) => string);
  8651. pathOptions?: PathData;
  8652. info?: AssetInfo;
  8653. identifier: string;
  8654. hash?: string;
  8655. auxiliary?: boolean;
  8656. }
  8657. declare interface RenderManifestOptions {
  8658. /**
  8659. * the chunk used to render
  8660. */
  8661. chunk: Chunk;
  8662. hash: string;
  8663. fullHash: string;
  8664. outputOptions: Output;
  8665. codeGenerationResults: CodeGenerationResults;
  8666. moduleTemplates: { javascript: ModuleTemplate };
  8667. dependencyTemplates: DependencyTemplates;
  8668. runtimeTemplate: RuntimeTemplate;
  8669. moduleGraph: ModuleGraph;
  8670. chunkGraph: ChunkGraph;
  8671. }
  8672. declare class ReplaceSource extends Source {
  8673. constructor(source: Source, name?: string);
  8674. replace(start: number, end: number, newValue: string, name?: string): void;
  8675. insert(pos: number, newValue: string, name?: string): void;
  8676. getName(): string;
  8677. original(): string;
  8678. getReplacements(): {
  8679. start: number;
  8680. end: number;
  8681. content: string;
  8682. insertIndex: number;
  8683. name: string;
  8684. }[];
  8685. }
  8686. declare abstract class RequestShortener {
  8687. contextify: (arg0: string) => string;
  8688. shorten(request?: null | string): undefined | null | string;
  8689. }
  8690. declare interface ResolveBuildDependenciesResult {
  8691. /**
  8692. * list of files
  8693. */
  8694. files: Set<string>;
  8695. /**
  8696. * list of directories
  8697. */
  8698. directories: Set<string>;
  8699. /**
  8700. * list of missing entries
  8701. */
  8702. missing: Set<string>;
  8703. /**
  8704. * stored resolve results
  8705. */
  8706. resolveResults: Map<string, string | false>;
  8707. /**
  8708. * dependencies of the resolving
  8709. */
  8710. resolveDependencies: {
  8711. /**
  8712. * list of files
  8713. */
  8714. files: Set<string>;
  8715. /**
  8716. * list of directories
  8717. */
  8718. directories: Set<string>;
  8719. /**
  8720. * list of missing entries
  8721. */
  8722. missing: Set<string>;
  8723. };
  8724. }
  8725. /**
  8726. * Resolve context
  8727. */
  8728. declare interface ResolveContext {
  8729. contextDependencies?: WriteOnlySet<string>;
  8730. /**
  8731. * files that was found on file system
  8732. */
  8733. fileDependencies?: WriteOnlySet<string>;
  8734. /**
  8735. * dependencies that was not found on file system
  8736. */
  8737. missingDependencies?: WriteOnlySet<string>;
  8738. /**
  8739. * set of hooks' calls. For instance, `resolve → parsedResolve → describedResolve`,
  8740. */
  8741. stack?: Set<string>;
  8742. /**
  8743. * log function
  8744. */
  8745. log?: (arg0: string) => void;
  8746. /**
  8747. * yield result, if provided plugins can return several results
  8748. */
  8749. yield?: (arg0: ResolveRequest) => void;
  8750. }
  8751. declare interface ResolveData {
  8752. contextInfo: ModuleFactoryCreateDataContextInfo;
  8753. resolveOptions?: ResolveOptionsWebpackOptions;
  8754. context: string;
  8755. request: string;
  8756. assertions?: Record<string, any>;
  8757. dependencies: ModuleDependency[];
  8758. dependencyType: string;
  8759. createData: Partial<NormalModuleCreateData & { settings: ModuleSettings }>;
  8760. fileDependencies: LazySet<string>;
  8761. missingDependencies: LazySet<string>;
  8762. contextDependencies: LazySet<string>;
  8763. /**
  8764. * allow to use the unsafe cache
  8765. */
  8766. cacheable: boolean;
  8767. }
  8768. declare interface ResolveOptionsTypes {
  8769. alias: AliasOption[];
  8770. fallback: AliasOption[];
  8771. aliasFields: Set<string | string[]>;
  8772. cachePredicate: (arg0: ResolveRequest) => boolean;
  8773. cacheWithContext: boolean;
  8774. /**
  8775. * A list of exports field condition names.
  8776. */
  8777. conditionNames: Set<string>;
  8778. descriptionFiles: string[];
  8779. enforceExtension: boolean;
  8780. exportsFields: Set<string | string[]>;
  8781. importsFields: Set<string | string[]>;
  8782. extensions: Set<string>;
  8783. fileSystem: FileSystem;
  8784. unsafeCache: false | object;
  8785. symlinks: boolean;
  8786. resolver?: Resolver;
  8787. modules: (string | string[])[];
  8788. mainFields: { name: string[]; forceRelative: boolean }[];
  8789. mainFiles: Set<string>;
  8790. plugins: Plugin[];
  8791. pnpApi: null | PnpApiImpl;
  8792. roots: Set<string>;
  8793. fullySpecified: boolean;
  8794. resolveToContext: boolean;
  8795. restrictions: Set<string | RegExp>;
  8796. preferRelative: boolean;
  8797. preferAbsolute: boolean;
  8798. }
  8799. /**
  8800. * Options object for resolving requests.
  8801. */
  8802. declare interface ResolveOptionsWebpackOptions {
  8803. /**
  8804. * Redirect module requests.
  8805. */
  8806. alias?:
  8807. | {
  8808. /**
  8809. * New request.
  8810. */
  8811. alias: string | false | string[];
  8812. /**
  8813. * Request to be redirected.
  8814. */
  8815. name: string;
  8816. /**
  8817. * Redirect only exact matching request.
  8818. */
  8819. onlyModule?: boolean;
  8820. }[]
  8821. | { [index: string]: string | false | string[] };
  8822. /**
  8823. * Fields in the description file (usually package.json) which are used to redirect requests inside the module.
  8824. */
  8825. aliasFields?: (string | string[])[];
  8826. /**
  8827. * Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm".
  8828. */
  8829. byDependency?: { [index: string]: ResolveOptionsWebpackOptions };
  8830. /**
  8831. * Enable caching of successfully resolved requests (cache entries are revalidated).
  8832. */
  8833. cache?: boolean;
  8834. /**
  8835. * Predicate function to decide which requests should be cached.
  8836. */
  8837. cachePredicate?: (request: ResolveRequest) => boolean;
  8838. /**
  8839. * Include the context information in the cache identifier when caching.
  8840. */
  8841. cacheWithContext?: boolean;
  8842. /**
  8843. * Condition names for exports field entry point.
  8844. */
  8845. conditionNames?: string[];
  8846. /**
  8847. * Filenames used to find a description file (like a package.json).
  8848. */
  8849. descriptionFiles?: string[];
  8850. /**
  8851. * Enforce the resolver to use one of the extensions from the extensions option (User must specify requests without extension).
  8852. */
  8853. enforceExtension?: boolean;
  8854. /**
  8855. * Field names from the description file (usually package.json) which are used to provide entry points of a package.
  8856. */
  8857. exportsFields?: string[];
  8858. /**
  8859. * Extensions added to the request when trying to find the file.
  8860. */
  8861. extensions?: string[];
  8862. /**
  8863. * Redirect module requests when normal resolving fails.
  8864. */
  8865. fallback?:
  8866. | {
  8867. /**
  8868. * New request.
  8869. */
  8870. alias: string | false | string[];
  8871. /**
  8872. * Request to be redirected.
  8873. */
  8874. name: string;
  8875. /**
  8876. * Redirect only exact matching request.
  8877. */
  8878. onlyModule?: boolean;
  8879. }[]
  8880. | { [index: string]: string | false | string[] };
  8881. /**
  8882. * Filesystem for the resolver.
  8883. */
  8884. fileSystem?: InputFileSystem;
  8885. /**
  8886. * Treats the request specified by the user as fully specified, meaning no extensions are added and the mainFiles in directories are not resolved (This doesn't affect requests from mainFields, aliasFields or aliases).
  8887. */
  8888. fullySpecified?: boolean;
  8889. /**
  8890. * Field names from the description file (usually package.json) which are used to provide internal request of a package (requests starting with # are considered as internal).
  8891. */
  8892. importsFields?: string[];
  8893. /**
  8894. * Field names from the description file (package.json) which are used to find the default entry point.
  8895. */
  8896. mainFields?: (string | string[])[];
  8897. /**
  8898. * Filenames used to find the default entry point if there is no description file or main field.
  8899. */
  8900. mainFiles?: string[];
  8901. /**
  8902. * Folder names or directory paths where to find modules.
  8903. */
  8904. modules?: string[];
  8905. /**
  8906. * Plugins for the resolver.
  8907. */
  8908. plugins?: (ResolvePluginInstance | "...")[];
  8909. /**
  8910. * Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.
  8911. */
  8912. preferAbsolute?: boolean;
  8913. /**
  8914. * Prefer to resolve module requests as relative request and fallback to resolving as module.
  8915. */
  8916. preferRelative?: boolean;
  8917. /**
  8918. * Custom resolver.
  8919. */
  8920. resolver?: Resolver;
  8921. /**
  8922. * A list of resolve restrictions. Resolve results must fulfill all of these restrictions to resolve successfully. Other resolve paths are taken when restrictions are not met.
  8923. */
  8924. restrictions?: (string | RegExp)[];
  8925. /**
  8926. * A list of directories in which requests that are server-relative URLs (starting with '/') are resolved.
  8927. */
  8928. roots?: string[];
  8929. /**
  8930. * Enable resolving symlinks to the original location.
  8931. */
  8932. symlinks?: boolean;
  8933. /**
  8934. * Enable caching of successfully resolved requests (cache entries are not revalidated).
  8935. */
  8936. unsafeCache?: boolean | { [index: string]: any };
  8937. /**
  8938. * Use synchronous filesystem calls for the resolver.
  8939. */
  8940. useSyncFileSystemCalls?: boolean;
  8941. }
  8942. type ResolveOptionsWithDependencyType = ResolveOptionsWebpackOptions & {
  8943. dependencyType?: string;
  8944. resolveToContext?: boolean;
  8945. };
  8946. /**
  8947. * Plugin instance.
  8948. */
  8949. declare interface ResolvePluginInstance {
  8950. [index: string]: any;
  8951. /**
  8952. * The run point of the plugin, required method.
  8953. */
  8954. apply: (resolver: Resolver) => void;
  8955. }
  8956. type ResolveRequest = BaseResolveRequest & Partial<ParsedIdentifier>;
  8957. declare interface ResolvedContextFileSystemInfoEntry {
  8958. safeTime: number;
  8959. timestampHash?: string;
  8960. }
  8961. declare interface ResolvedContextTimestampAndHash {
  8962. safeTime: number;
  8963. timestampHash?: string;
  8964. hash: string;
  8965. }
  8966. declare abstract class Resolver {
  8967. fileSystem: FileSystem;
  8968. options: ResolveOptionsTypes;
  8969. hooks: {
  8970. resolveStep: SyncHook<
  8971. [
  8972. AsyncSeriesBailHook<
  8973. [ResolveRequest, ResolveContext],
  8974. null | ResolveRequest
  8975. >,
  8976. ResolveRequest
  8977. ]
  8978. >;
  8979. noResolve: SyncHook<[ResolveRequest, Error]>;
  8980. resolve: AsyncSeriesBailHook<
  8981. [ResolveRequest, ResolveContext],
  8982. null | ResolveRequest
  8983. >;
  8984. result: AsyncSeriesHook<[ResolveRequest, ResolveContext]>;
  8985. };
  8986. ensureHook(
  8987. name:
  8988. | string
  8989. | AsyncSeriesBailHook<
  8990. [ResolveRequest, ResolveContext],
  8991. null | ResolveRequest
  8992. >
  8993. ): AsyncSeriesBailHook<
  8994. [ResolveRequest, ResolveContext],
  8995. null | ResolveRequest
  8996. >;
  8997. getHook(
  8998. name:
  8999. | string
  9000. | AsyncSeriesBailHook<
  9001. [ResolveRequest, ResolveContext],
  9002. null | ResolveRequest
  9003. >
  9004. ): AsyncSeriesBailHook<
  9005. [ResolveRequest, ResolveContext],
  9006. null | ResolveRequest
  9007. >;
  9008. resolveSync(context: object, path: string, request: string): string | false;
  9009. resolve(
  9010. context: object,
  9011. path: string,
  9012. request: string,
  9013. resolveContext: ResolveContext,
  9014. callback: (
  9015. arg0: null | Error,
  9016. arg1?: string | false,
  9017. arg2?: ResolveRequest
  9018. ) => void
  9019. ): void;
  9020. doResolve(
  9021. hook?: any,
  9022. request?: any,
  9023. message?: any,
  9024. resolveContext?: any,
  9025. callback?: any
  9026. ): any;
  9027. parse(identifier: string): ParsedIdentifier;
  9028. isModule(path?: any): boolean;
  9029. isPrivate(path?: any): boolean;
  9030. isDirectory(path: string): boolean;
  9031. join(path?: any, request?: any): string;
  9032. normalize(path?: any): string;
  9033. }
  9034. declare interface ResolverCache {
  9035. direct: WeakMap<Object, ResolverWithOptions>;
  9036. stringified: Map<string, ResolverWithOptions>;
  9037. }
  9038. declare abstract class ResolverFactory {
  9039. hooks: Readonly<{
  9040. resolveOptions: HookMap<
  9041. SyncWaterfallHook<[ResolveOptionsWithDependencyType]>
  9042. >;
  9043. resolver: HookMap<
  9044. SyncHook<[Resolver, UserResolveOptions, ResolveOptionsWithDependencyType]>
  9045. >;
  9046. }>;
  9047. cache: Map<string, ResolverCache>;
  9048. get(
  9049. type: string,
  9050. resolveOptions?: ResolveOptionsWithDependencyType
  9051. ): ResolverWithOptions;
  9052. }
  9053. type ResolverWithOptions = Resolver & WithOptions;
  9054. declare interface ResourceDataWithData {
  9055. resource: string;
  9056. path: string;
  9057. query: string;
  9058. fragment: string;
  9059. context?: string;
  9060. data: Record<string, any>;
  9061. }
  9062. type Rule = string | RegExp;
  9063. declare interface RuleSet {
  9064. /**
  9065. * map of references in the rule set (may grow over time)
  9066. */
  9067. references: Map<string, any>;
  9068. /**
  9069. * execute the rule set
  9070. */
  9071. exec: (arg0: object) => Effect[];
  9072. }
  9073. type RuleSetCondition =
  9074. | string
  9075. | RegExp
  9076. | ((value: string) => boolean)
  9077. | RuleSetLogicalConditions
  9078. | RuleSetCondition[];
  9079. type RuleSetConditionAbsolute =
  9080. | string
  9081. | RegExp
  9082. | ((value: string) => boolean)
  9083. | RuleSetLogicalConditionsAbsolute
  9084. | RuleSetConditionAbsolute[];
  9085. type RuleSetConditionOrConditions =
  9086. | string
  9087. | RegExp
  9088. | ((value: string) => boolean)
  9089. | RuleSetLogicalConditions
  9090. | RuleSetCondition[];
  9091. /**
  9092. * Logic operators used in a condition matcher.
  9093. */
  9094. declare interface RuleSetLogicalConditions {
  9095. /**
  9096. * Logical AND.
  9097. */
  9098. and?: RuleSetCondition[];
  9099. /**
  9100. * Logical NOT.
  9101. */
  9102. not?:
  9103. | string
  9104. | RegExp
  9105. | ((value: string) => boolean)
  9106. | RuleSetLogicalConditions
  9107. | RuleSetCondition[];
  9108. /**
  9109. * Logical OR.
  9110. */
  9111. or?: RuleSetCondition[];
  9112. }
  9113. /**
  9114. * Logic operators used in a condition matcher.
  9115. */
  9116. declare interface RuleSetLogicalConditionsAbsolute {
  9117. /**
  9118. * Logical AND.
  9119. */
  9120. and?: RuleSetConditionAbsolute[];
  9121. /**
  9122. * Logical NOT.
  9123. */
  9124. not?:
  9125. | string
  9126. | RegExp
  9127. | ((value: string) => boolean)
  9128. | RuleSetLogicalConditionsAbsolute
  9129. | RuleSetConditionAbsolute[];
  9130. /**
  9131. * Logical OR.
  9132. */
  9133. or?: RuleSetConditionAbsolute[];
  9134. }
  9135. /**
  9136. * A rule description with conditions and effects for modules.
  9137. */
  9138. declare interface RuleSetRule {
  9139. /**
  9140. * Match on import assertions of the dependency.
  9141. */
  9142. assert?: { [index: string]: RuleSetConditionOrConditions };
  9143. /**
  9144. * Match the child compiler name.
  9145. */
  9146. compiler?:
  9147. | string
  9148. | RegExp
  9149. | ((value: string) => boolean)
  9150. | RuleSetLogicalConditions
  9151. | RuleSetCondition[];
  9152. /**
  9153. * Match dependency type.
  9154. */
  9155. dependency?:
  9156. | string
  9157. | RegExp
  9158. | ((value: string) => boolean)
  9159. | RuleSetLogicalConditions
  9160. | RuleSetCondition[];
  9161. /**
  9162. * Match values of properties in the description file (usually package.json).
  9163. */
  9164. descriptionData?: { [index: string]: RuleSetConditionOrConditions };
  9165. /**
  9166. * Enforce this rule as pre or post step.
  9167. */
  9168. enforce?: "pre" | "post";
  9169. /**
  9170. * Shortcut for resource.exclude.
  9171. */
  9172. exclude?:
  9173. | string
  9174. | RegExp
  9175. | ((value: string) => boolean)
  9176. | RuleSetLogicalConditionsAbsolute
  9177. | RuleSetConditionAbsolute[];
  9178. /**
  9179. * The options for the module generator.
  9180. */
  9181. generator?: { [index: string]: any };
  9182. /**
  9183. * Shortcut for resource.include.
  9184. */
  9185. include?:
  9186. | string
  9187. | RegExp
  9188. | ((value: string) => boolean)
  9189. | RuleSetLogicalConditionsAbsolute
  9190. | RuleSetConditionAbsolute[];
  9191. /**
  9192. * Match the issuer of the module (The module pointing to this module).
  9193. */
  9194. issuer?:
  9195. | string
  9196. | RegExp
  9197. | ((value: string) => boolean)
  9198. | RuleSetLogicalConditionsAbsolute
  9199. | RuleSetConditionAbsolute[];
  9200. /**
  9201. * Match layer of the issuer of this module (The module pointing to this module).
  9202. */
  9203. issuerLayer?:
  9204. | string
  9205. | RegExp
  9206. | ((value: string) => boolean)
  9207. | RuleSetLogicalConditions
  9208. | RuleSetCondition[];
  9209. /**
  9210. * Specifies the layer in which the module should be placed in.
  9211. */
  9212. layer?: string;
  9213. /**
  9214. * Shortcut for use.loader.
  9215. */
  9216. loader?: string;
  9217. /**
  9218. * Match module mimetype when load from Data URI.
  9219. */
  9220. mimetype?:
  9221. | string
  9222. | RegExp
  9223. | ((value: string) => boolean)
  9224. | RuleSetLogicalConditions
  9225. | RuleSetCondition[];
  9226. /**
  9227. * Only execute the first matching rule in this array.
  9228. */
  9229. oneOf?: RuleSetRule[];
  9230. /**
  9231. * Shortcut for use.options.
  9232. */
  9233. options?: string | { [index: string]: any };
  9234. /**
  9235. * Options for parsing.
  9236. */
  9237. parser?: { [index: string]: any };
  9238. /**
  9239. * Match the real resource path of the module.
  9240. */
  9241. realResource?:
  9242. | string
  9243. | RegExp
  9244. | ((value: string) => boolean)
  9245. | RuleSetLogicalConditionsAbsolute
  9246. | RuleSetConditionAbsolute[];
  9247. /**
  9248. * Options for the resolver.
  9249. */
  9250. resolve?: ResolveOptionsWebpackOptions;
  9251. /**
  9252. * Match the resource path of the module.
  9253. */
  9254. resource?:
  9255. | string
  9256. | RegExp
  9257. | ((value: string) => boolean)
  9258. | RuleSetLogicalConditionsAbsolute
  9259. | RuleSetConditionAbsolute[];
  9260. /**
  9261. * Match the resource fragment of the module.
  9262. */
  9263. resourceFragment?:
  9264. | string
  9265. | RegExp
  9266. | ((value: string) => boolean)
  9267. | RuleSetLogicalConditions
  9268. | RuleSetCondition[];
  9269. /**
  9270. * Match the resource query of the module.
  9271. */
  9272. resourceQuery?:
  9273. | string
  9274. | RegExp
  9275. | ((value: string) => boolean)
  9276. | RuleSetLogicalConditions
  9277. | RuleSetCondition[];
  9278. /**
  9279. * Match and execute these rules when this rule is matched.
  9280. */
  9281. rules?: RuleSetRule[];
  9282. /**
  9283. * Match module scheme.
  9284. */
  9285. scheme?:
  9286. | string
  9287. | RegExp
  9288. | ((value: string) => boolean)
  9289. | RuleSetLogicalConditions
  9290. | RuleSetCondition[];
  9291. /**
  9292. * Flags a module as with or without side effects.
  9293. */
  9294. sideEffects?: boolean;
  9295. /**
  9296. * Shortcut for resource.test.
  9297. */
  9298. test?:
  9299. | string
  9300. | RegExp
  9301. | ((value: string) => boolean)
  9302. | RuleSetLogicalConditionsAbsolute
  9303. | RuleSetConditionAbsolute[];
  9304. /**
  9305. * Module type to use for the module.
  9306. */
  9307. type?: string;
  9308. /**
  9309. * Modifiers applied to the module when rule is matched.
  9310. */
  9311. use?:
  9312. | string
  9313. | RuleSetUseItem[]
  9314. | ((data: {
  9315. resource: string;
  9316. realResource: string;
  9317. resourceQuery: string;
  9318. issuer: string;
  9319. compiler: string;
  9320. }) => RuleSetUseItem[])
  9321. | {
  9322. /**
  9323. * Unique loader options identifier.
  9324. */
  9325. ident?: string;
  9326. /**
  9327. * Loader name.
  9328. */
  9329. loader?: string;
  9330. /**
  9331. * Loader options.
  9332. */
  9333. options?: string | { [index: string]: any };
  9334. }
  9335. | ((data: object) =>
  9336. | string
  9337. | {
  9338. /**
  9339. * Unique loader options identifier.
  9340. */
  9341. ident?: string;
  9342. /**
  9343. * Loader name.
  9344. */
  9345. loader?: string;
  9346. /**
  9347. * Loader options.
  9348. */
  9349. options?: string | { [index: string]: any };
  9350. }
  9351. | __TypeWebpackOptions
  9352. | RuleSetUseItem[]);
  9353. }
  9354. type RuleSetUse =
  9355. | string
  9356. | RuleSetUseItem[]
  9357. | ((data: {
  9358. resource: string;
  9359. realResource: string;
  9360. resourceQuery: string;
  9361. issuer: string;
  9362. compiler: string;
  9363. }) => RuleSetUseItem[])
  9364. | {
  9365. /**
  9366. * Unique loader options identifier.
  9367. */
  9368. ident?: string;
  9369. /**
  9370. * Loader name.
  9371. */
  9372. loader?: string;
  9373. /**
  9374. * Loader options.
  9375. */
  9376. options?: string | { [index: string]: any };
  9377. }
  9378. | __TypeWebpackOptions;
  9379. type RuleSetUseItem =
  9380. | string
  9381. | {
  9382. /**
  9383. * Unique loader options identifier.
  9384. */
  9385. ident?: string;
  9386. /**
  9387. * Loader name.
  9388. */
  9389. loader?: string;
  9390. /**
  9391. * Loader options.
  9392. */
  9393. options?: string | { [index: string]: any };
  9394. }
  9395. | __TypeWebpackOptions;
  9396. declare class RuntimeChunkPlugin {
  9397. constructor(options?: any);
  9398. options: any;
  9399. /**
  9400. * Apply the plugin
  9401. */
  9402. apply(compiler: Compiler): void;
  9403. }
  9404. type RuntimeCondition = undefined | string | boolean | SortableSet<string>;
  9405. declare class RuntimeModule extends Module {
  9406. constructor(name: string, stage?: number);
  9407. name: string;
  9408. stage: number;
  9409. compilation: Compilation;
  9410. chunk: Chunk;
  9411. chunkGraph: ChunkGraph;
  9412. fullHash: boolean;
  9413. dependentHash: boolean;
  9414. attach(compilation: Compilation, chunk: Chunk, chunkGraph?: ChunkGraph): void;
  9415. generate(): string;
  9416. getGeneratedCode(): string;
  9417. shouldIsolate(): boolean;
  9418. /**
  9419. * Runtime modules without any dependencies to other runtime modules
  9420. */
  9421. static STAGE_NORMAL: number;
  9422. /**
  9423. * Runtime modules with simple dependencies on other runtime modules
  9424. */
  9425. static STAGE_BASIC: number;
  9426. /**
  9427. * Runtime modules which attach to handlers of other runtime modules
  9428. */
  9429. static STAGE_ATTACH: number;
  9430. /**
  9431. * Runtime modules which trigger actions on bootstrap
  9432. */
  9433. static STAGE_TRIGGER: number;
  9434. }
  9435. declare interface RuntimeRequirementsContext {
  9436. /**
  9437. * the chunk graph
  9438. */
  9439. chunkGraph: ChunkGraph;
  9440. /**
  9441. * the code generation results
  9442. */
  9443. codeGenerationResults: CodeGenerationResults;
  9444. }
  9445. type RuntimeSpec = undefined | string | SortableSet<string>;
  9446. declare class RuntimeSpecMap<T> {
  9447. constructor(clone?: RuntimeSpecMap<T>);
  9448. get(runtime: RuntimeSpec): T;
  9449. has(runtime: RuntimeSpec): boolean;
  9450. set(runtime?: any, value?: any): void;
  9451. provide(runtime?: any, computer?: any): any;
  9452. delete(runtime?: any): void;
  9453. update(runtime?: any, fn?: any): void;
  9454. keys(): RuntimeSpec[];
  9455. values(): IterableIterator<T>;
  9456. readonly size?: number;
  9457. }
  9458. declare class RuntimeSpecSet {
  9459. constructor(iterable?: any);
  9460. add(runtime?: any): void;
  9461. has(runtime?: any): boolean;
  9462. readonly size: number;
  9463. [Symbol.iterator](): IterableIterator<RuntimeSpec>;
  9464. }
  9465. declare abstract class RuntimeTemplate {
  9466. compilation: Compilation;
  9467. outputOptions: OutputNormalized;
  9468. requestShortener: RequestShortener;
  9469. globalObject: string;
  9470. contentHashReplacement: string;
  9471. isIIFE(): undefined | boolean;
  9472. isModule(): undefined | boolean;
  9473. supportsConst(): undefined | boolean;
  9474. supportsArrowFunction(): undefined | boolean;
  9475. supportsOptionalChaining(): undefined | boolean;
  9476. supportsForOf(): undefined | boolean;
  9477. supportsDestructuring(): undefined | boolean;
  9478. supportsBigIntLiteral(): undefined | boolean;
  9479. supportsDynamicImport(): undefined | boolean;
  9480. supportsEcmaScriptModuleSyntax(): undefined | boolean;
  9481. supportTemplateLiteral(): undefined | boolean;
  9482. returningFunction(returnValue?: any, args?: string): string;
  9483. basicFunction(args?: any, body?: any): string;
  9484. concatenation(...args: (string | { expr: string })[]): string;
  9485. expressionFunction(expression?: any, args?: string): string;
  9486. emptyFunction(): "x => {}" | "function() {}";
  9487. destructureArray(items?: any, value?: any): string;
  9488. destructureObject(items?: any, value?: any): string;
  9489. iife(args?: any, body?: any): string;
  9490. forEach(variable?: any, array?: any, body?: any): string;
  9491. /**
  9492. * Add a comment
  9493. */
  9494. comment(__0: {
  9495. /**
  9496. * request string used originally
  9497. */
  9498. request?: string;
  9499. /**
  9500. * name of the chunk referenced
  9501. */
  9502. chunkName?: string;
  9503. /**
  9504. * reason information of the chunk
  9505. */
  9506. chunkReason?: string;
  9507. /**
  9508. * additional message
  9509. */
  9510. message?: string;
  9511. /**
  9512. * name of the export
  9513. */
  9514. exportName?: string;
  9515. }): string;
  9516. throwMissingModuleErrorBlock(__0: {
  9517. /**
  9518. * request string used originally
  9519. */
  9520. request?: string;
  9521. }): string;
  9522. throwMissingModuleErrorFunction(__0: {
  9523. /**
  9524. * request string used originally
  9525. */
  9526. request?: string;
  9527. }): string;
  9528. missingModule(__0: {
  9529. /**
  9530. * request string used originally
  9531. */
  9532. request?: string;
  9533. }): string;
  9534. missingModuleStatement(__0: {
  9535. /**
  9536. * request string used originally
  9537. */
  9538. request?: string;
  9539. }): string;
  9540. missingModulePromise(__0: {
  9541. /**
  9542. * request string used originally
  9543. */
  9544. request?: string;
  9545. }): string;
  9546. weakError(__0: {
  9547. /**
  9548. * the chunk graph
  9549. */
  9550. chunkGraph: ChunkGraph;
  9551. /**
  9552. * the module
  9553. */
  9554. module: Module;
  9555. /**
  9556. * the request that should be printed as comment
  9557. */
  9558. request: string;
  9559. /**
  9560. * expression to use as id expression
  9561. */
  9562. idExpr?: string;
  9563. /**
  9564. * which kind of code should be returned
  9565. */
  9566. type: "promise" | "expression" | "statements";
  9567. }): string;
  9568. moduleId(__0: {
  9569. /**
  9570. * the module
  9571. */
  9572. module: Module;
  9573. /**
  9574. * the chunk graph
  9575. */
  9576. chunkGraph: ChunkGraph;
  9577. /**
  9578. * the request that should be printed as comment
  9579. */
  9580. request: string;
  9581. /**
  9582. * if the dependency is weak (will create a nice error message)
  9583. */
  9584. weak?: boolean;
  9585. }): string;
  9586. moduleRaw(__0: {
  9587. /**
  9588. * the module
  9589. */
  9590. module: Module;
  9591. /**
  9592. * the chunk graph
  9593. */
  9594. chunkGraph: ChunkGraph;
  9595. /**
  9596. * the request that should be printed as comment
  9597. */
  9598. request: string;
  9599. /**
  9600. * if the dependency is weak (will create a nice error message)
  9601. */
  9602. weak?: boolean;
  9603. /**
  9604. * if set, will be filled with runtime requirements
  9605. */
  9606. runtimeRequirements: Set<string>;
  9607. }): string;
  9608. moduleExports(__0: {
  9609. /**
  9610. * the module
  9611. */
  9612. module: Module;
  9613. /**
  9614. * the chunk graph
  9615. */
  9616. chunkGraph: ChunkGraph;
  9617. /**
  9618. * the request that should be printed as comment
  9619. */
  9620. request: string;
  9621. /**
  9622. * if the dependency is weak (will create a nice error message)
  9623. */
  9624. weak?: boolean;
  9625. /**
  9626. * if set, will be filled with runtime requirements
  9627. */
  9628. runtimeRequirements: Set<string>;
  9629. }): string;
  9630. moduleNamespace(__0: {
  9631. /**
  9632. * the module
  9633. */
  9634. module: Module;
  9635. /**
  9636. * the chunk graph
  9637. */
  9638. chunkGraph: ChunkGraph;
  9639. /**
  9640. * the request that should be printed as comment
  9641. */
  9642. request: string;
  9643. /**
  9644. * if the current module is in strict esm mode
  9645. */
  9646. strict?: boolean;
  9647. /**
  9648. * if the dependency is weak (will create a nice error message)
  9649. */
  9650. weak?: boolean;
  9651. /**
  9652. * if set, will be filled with runtime requirements
  9653. */
  9654. runtimeRequirements: Set<string>;
  9655. }): string;
  9656. moduleNamespacePromise(__0: {
  9657. /**
  9658. * the chunk graph
  9659. */
  9660. chunkGraph: ChunkGraph;
  9661. /**
  9662. * the current dependencies block
  9663. */
  9664. block?: AsyncDependenciesBlock;
  9665. /**
  9666. * the module
  9667. */
  9668. module: Module;
  9669. /**
  9670. * the request that should be printed as comment
  9671. */
  9672. request: string;
  9673. /**
  9674. * a message for the comment
  9675. */
  9676. message: string;
  9677. /**
  9678. * if the current module is in strict esm mode
  9679. */
  9680. strict?: boolean;
  9681. /**
  9682. * if the dependency is weak (will create a nice error message)
  9683. */
  9684. weak?: boolean;
  9685. /**
  9686. * if set, will be filled with runtime requirements
  9687. */
  9688. runtimeRequirements: Set<string>;
  9689. }): string;
  9690. runtimeConditionExpression(__0: {
  9691. /**
  9692. * the chunk graph
  9693. */
  9694. chunkGraph: ChunkGraph;
  9695. /**
  9696. * runtime for which this code will be generated
  9697. */
  9698. runtime?: RuntimeSpec;
  9699. /**
  9700. * only execute the statement in some runtimes
  9701. */
  9702. runtimeCondition?: string | boolean | SortableSet<string>;
  9703. /**
  9704. * if set, will be filled with runtime requirements
  9705. */
  9706. runtimeRequirements: Set<string>;
  9707. }): string;
  9708. importStatement(__0: {
  9709. /**
  9710. * whether a new variable should be created or the existing one updated
  9711. */
  9712. update?: boolean;
  9713. /**
  9714. * the module
  9715. */
  9716. module: Module;
  9717. /**
  9718. * the chunk graph
  9719. */
  9720. chunkGraph: ChunkGraph;
  9721. /**
  9722. * the request that should be printed as comment
  9723. */
  9724. request: string;
  9725. /**
  9726. * name of the import variable
  9727. */
  9728. importVar: string;
  9729. /**
  9730. * module in which the statement is emitted
  9731. */
  9732. originModule: Module;
  9733. /**
  9734. * true, if this is a weak dependency
  9735. */
  9736. weak?: boolean;
  9737. /**
  9738. * if set, will be filled with runtime requirements
  9739. */
  9740. runtimeRequirements: Set<string>;
  9741. }): [string, string];
  9742. exportFromImport(__0: {
  9743. /**
  9744. * the module graph
  9745. */
  9746. moduleGraph: ModuleGraph;
  9747. /**
  9748. * the module
  9749. */
  9750. module: Module;
  9751. /**
  9752. * the request
  9753. */
  9754. request: string;
  9755. /**
  9756. * the export name
  9757. */
  9758. exportName: string | string[];
  9759. /**
  9760. * the origin module
  9761. */
  9762. originModule: Module;
  9763. /**
  9764. * true, if location is safe for ASI, a bracket can be emitted
  9765. */
  9766. asiSafe?: boolean;
  9767. /**
  9768. * true, if expression will be called
  9769. */
  9770. isCall: boolean;
  9771. /**
  9772. * when false, call context will not be preserved
  9773. */
  9774. callContext: boolean;
  9775. /**
  9776. * when true and accessing the default exports, interop code will be generated
  9777. */
  9778. defaultInterop: boolean;
  9779. /**
  9780. * the identifier name of the import variable
  9781. */
  9782. importVar: string;
  9783. /**
  9784. * init fragments will be added here
  9785. */
  9786. initFragments: InitFragment<any>[];
  9787. /**
  9788. * runtime for which this code will be generated
  9789. */
  9790. runtime: RuntimeSpec;
  9791. /**
  9792. * if set, will be filled with runtime requirements
  9793. */
  9794. runtimeRequirements: Set<string>;
  9795. }): string;
  9796. blockPromise(__0: {
  9797. /**
  9798. * the async block
  9799. */
  9800. block: AsyncDependenciesBlock;
  9801. /**
  9802. * the message
  9803. */
  9804. message: string;
  9805. /**
  9806. * the chunk graph
  9807. */
  9808. chunkGraph: ChunkGraph;
  9809. /**
  9810. * if set, will be filled with runtime requirements
  9811. */
  9812. runtimeRequirements: Set<string>;
  9813. }): string;
  9814. asyncModuleFactory(__0: {
  9815. /**
  9816. * the async block
  9817. */
  9818. block: AsyncDependenciesBlock;
  9819. /**
  9820. * the chunk graph
  9821. */
  9822. chunkGraph: ChunkGraph;
  9823. /**
  9824. * if set, will be filled with runtime requirements
  9825. */
  9826. runtimeRequirements: Set<string>;
  9827. /**
  9828. * request string used originally
  9829. */
  9830. request?: string;
  9831. }): string;
  9832. syncModuleFactory(__0: {
  9833. /**
  9834. * the dependency
  9835. */
  9836. dependency: Dependency;
  9837. /**
  9838. * the chunk graph
  9839. */
  9840. chunkGraph: ChunkGraph;
  9841. /**
  9842. * if set, will be filled with runtime requirements
  9843. */
  9844. runtimeRequirements: Set<string>;
  9845. /**
  9846. * request string used originally
  9847. */
  9848. request?: string;
  9849. }): string;
  9850. defineEsModuleFlagStatement(__0: {
  9851. /**
  9852. * the name of the exports object
  9853. */
  9854. exportsArgument: string;
  9855. /**
  9856. * if set, will be filled with runtime requirements
  9857. */
  9858. runtimeRequirements: Set<string>;
  9859. }): string;
  9860. assetUrl(__0: {
  9861. /**
  9862. * the module
  9863. */
  9864. module: Module;
  9865. /**
  9866. * the public path
  9867. */
  9868. publicPath: string;
  9869. /**
  9870. * runtime
  9871. */
  9872. runtime?: RuntimeSpec;
  9873. /**
  9874. * the code generation results
  9875. */
  9876. codeGenerationResults: CodeGenerationResults;
  9877. }): string;
  9878. }
  9879. declare abstract class RuntimeValue {
  9880. fn: (arg0: {
  9881. module: NormalModule;
  9882. key: string;
  9883. readonly version?: string;
  9884. }) => CodeValuePrimitive;
  9885. options: true | RuntimeValueOptions;
  9886. readonly fileDependencies?: true | string[];
  9887. exec(
  9888. parser: JavascriptParser,
  9889. valueCacheVersions: Map<string, string | Set<string>>,
  9890. key: string
  9891. ): CodeValuePrimitive;
  9892. getCacheVersion(): undefined | string;
  9893. }
  9894. declare interface RuntimeValueOptions {
  9895. fileDependencies?: string[];
  9896. contextDependencies?: string[];
  9897. missingDependencies?: string[];
  9898. buildDependencies?: string[];
  9899. version?: string | (() => string);
  9900. }
  9901. declare interface ScopeInfo {
  9902. definitions: StackedMap<string, ScopeInfo | VariableInfo>;
  9903. topLevelScope: boolean | "arrow";
  9904. inShorthand: boolean;
  9905. isStrict: boolean;
  9906. isAsmJs: boolean;
  9907. inTry: boolean;
  9908. }
  9909. declare interface Selector<A, B> {
  9910. (input: A): B;
  9911. }
  9912. declare abstract class Serializer {
  9913. serializeMiddlewares: any;
  9914. deserializeMiddlewares: any;
  9915. context: any;
  9916. serialize(obj?: any, context?: any): any;
  9917. deserialize(value?: any, context?: any): any;
  9918. }
  9919. type ServerOptionsHttps = SecureContextOptions &
  9920. TlsOptions &
  9921. ServerOptionsImport;
  9922. declare class SharePlugin {
  9923. constructor(options: SharePluginOptions);
  9924. /**
  9925. * Apply the plugin
  9926. */
  9927. apply(compiler: Compiler): void;
  9928. }
  9929. /**
  9930. * Options for shared modules.
  9931. */
  9932. declare interface SharePluginOptions {
  9933. /**
  9934. * Share scope name used for all shared modules (defaults to 'default').
  9935. */
  9936. shareScope?: string;
  9937. /**
  9938. * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
  9939. */
  9940. shared: Shared;
  9941. }
  9942. type Shared = (string | SharedObject)[] | SharedObject;
  9943. /**
  9944. * Advanced configuration for modules that should be shared in the share scope.
  9945. */
  9946. declare interface SharedConfig {
  9947. /**
  9948. * Include the provided and fallback module directly instead behind an async request. This allows to use this shared module in initial load too. All possible shared modules need to be eager too.
  9949. */
  9950. eager?: boolean;
  9951. /**
  9952. * Provided module that should be provided to share scope. Also acts as fallback module if no shared module is found in share scope or version isn't valid. Defaults to the property name.
  9953. */
  9954. import?: string | false;
  9955. /**
  9956. * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
  9957. */
  9958. packageName?: string;
  9959. /**
  9960. * Version requirement from module in share scope.
  9961. */
  9962. requiredVersion?: string | false;
  9963. /**
  9964. * Module is looked up under this key from the share scope.
  9965. */
  9966. shareKey?: string;
  9967. /**
  9968. * Share scope name.
  9969. */
  9970. shareScope?: string;
  9971. /**
  9972. * Allow only a single version of the shared module in share scope (disabled by default).
  9973. */
  9974. singleton?: boolean;
  9975. /**
  9976. * Do not accept shared module if version is not valid (defaults to yes, if local fallback module is available and shared module is not a singleton, otherwise no, has no effect if there is no required version specified).
  9977. */
  9978. strictVersion?: boolean;
  9979. /**
  9980. * Version of the provided module. Will replace lower matching versions, but not higher.
  9981. */
  9982. version?: string | false;
  9983. }
  9984. /**
  9985. * Modules that should be shared in the share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash.
  9986. */
  9987. declare interface SharedObject {
  9988. [index: string]: string | SharedConfig;
  9989. }
  9990. declare class SideEffectsFlagPlugin {
  9991. constructor(analyseSource?: boolean);
  9992. /**
  9993. * Apply the plugin
  9994. */
  9995. apply(compiler: Compiler): void;
  9996. static moduleHasSideEffects(
  9997. moduleName?: any,
  9998. flagValue?: any,
  9999. cache?: any
  10000. ): any;
  10001. }
  10002. declare class SizeOnlySource extends Source {
  10003. constructor(size: number);
  10004. }
  10005. declare abstract class Snapshot {
  10006. startTime?: number;
  10007. fileTimestamps?: Map<string, null | FileSystemInfoEntry>;
  10008. fileHashes?: Map<string, null | string>;
  10009. fileTshs?: Map<string, null | string | TimestampAndHash>;
  10010. contextTimestamps?: Map<string, null | ResolvedContextFileSystemInfoEntry>;
  10011. contextHashes?: Map<string, null | string>;
  10012. contextTshs?: Map<string, null | ResolvedContextTimestampAndHash>;
  10013. missingExistence?: Map<string, boolean>;
  10014. managedItemInfo?: Map<string, string>;
  10015. managedFiles?: Set<string>;
  10016. managedContexts?: Set<string>;
  10017. managedMissing?: Set<string>;
  10018. children?: Set<Snapshot>;
  10019. hasStartTime(): boolean;
  10020. setStartTime(value?: any): void;
  10021. setMergedStartTime(value?: any, snapshot?: any): void;
  10022. hasFileTimestamps(): boolean;
  10023. setFileTimestamps(value?: any): void;
  10024. hasFileHashes(): boolean;
  10025. setFileHashes(value?: any): void;
  10026. hasFileTshs(): boolean;
  10027. setFileTshs(value?: any): void;
  10028. hasContextTimestamps(): boolean;
  10029. setContextTimestamps(value?: any): void;
  10030. hasContextHashes(): boolean;
  10031. setContextHashes(value?: any): void;
  10032. hasContextTshs(): boolean;
  10033. setContextTshs(value?: any): void;
  10034. hasMissingExistence(): boolean;
  10035. setMissingExistence(value?: any): void;
  10036. hasManagedItemInfo(): boolean;
  10037. setManagedItemInfo(value?: any): void;
  10038. hasManagedFiles(): boolean;
  10039. setManagedFiles(value?: any): void;
  10040. hasManagedContexts(): boolean;
  10041. setManagedContexts(value?: any): void;
  10042. hasManagedMissing(): boolean;
  10043. setManagedMissing(value?: any): void;
  10044. hasChildren(): boolean;
  10045. setChildren(value?: any): void;
  10046. addChild(child?: any): void;
  10047. serialize(__0: { write: any }): void;
  10048. deserialize(__0: { read: any }): void;
  10049. getFileIterable(): Iterable<string>;
  10050. getContextIterable(): Iterable<string>;
  10051. getMissingIterable(): Iterable<string>;
  10052. }
  10053. /**
  10054. * Options affecting how file system snapshots are created and validated.
  10055. */
  10056. declare interface SnapshotOptions {
  10057. /**
  10058. * Options for snapshotting build dependencies to determine if the whole cache need to be invalidated.
  10059. */
  10060. buildDependencies?: {
  10061. /**
  10062. * Use hashes of the content of the files/directories to determine invalidation.
  10063. */
  10064. hash?: boolean;
  10065. /**
  10066. * Use timestamps of the files/directories to determine invalidation.
  10067. */
  10068. timestamp?: boolean;
  10069. };
  10070. /**
  10071. * List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
  10072. */
  10073. immutablePaths?: (string | RegExp)[];
  10074. /**
  10075. * List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
  10076. */
  10077. managedPaths?: (string | RegExp)[];
  10078. /**
  10079. * Options for snapshotting dependencies of modules to determine if they need to be built again.
  10080. */
  10081. module?: {
  10082. /**
  10083. * Use hashes of the content of the files/directories to determine invalidation.
  10084. */
  10085. hash?: boolean;
  10086. /**
  10087. * Use timestamps of the files/directories to determine invalidation.
  10088. */
  10089. timestamp?: boolean;
  10090. };
  10091. /**
  10092. * Options for snapshotting dependencies of request resolving to determine if requests need to be re-resolved.
  10093. */
  10094. resolve?: {
  10095. /**
  10096. * Use hashes of the content of the files/directories to determine invalidation.
  10097. */
  10098. hash?: boolean;
  10099. /**
  10100. * Use timestamps of the files/directories to determine invalidation.
  10101. */
  10102. timestamp?: boolean;
  10103. };
  10104. /**
  10105. * Options for snapshotting the resolving of build dependencies to determine if the build dependencies need to be re-resolved.
  10106. */
  10107. resolveBuildDependencies?: {
  10108. /**
  10109. * Use hashes of the content of the files/directories to determine invalidation.
  10110. */
  10111. hash?: boolean;
  10112. /**
  10113. * Use timestamps of the files/directories to determine invalidation.
  10114. */
  10115. timestamp?: boolean;
  10116. };
  10117. }
  10118. declare abstract class SortableSet<T> extends Set<T> {
  10119. /**
  10120. * Sort with a comparer function
  10121. */
  10122. sortWith(sortFn: (arg0: T, arg1: T) => number): void;
  10123. sort(): SortableSet<T>;
  10124. /**
  10125. * Get data from cache
  10126. */
  10127. getFromCache<R>(fn: (arg0: SortableSet<T>) => R): R;
  10128. /**
  10129. * Get data from cache (ignoring sorting)
  10130. */
  10131. getFromUnorderedCache<R>(fn: (arg0: SortableSet<T>) => R): R;
  10132. toJSON(): T[];
  10133. /**
  10134. * Iterates over values in the set.
  10135. */
  10136. [Symbol.iterator](): IterableIterator<T>;
  10137. }
  10138. declare class Source {
  10139. constructor();
  10140. size(): number;
  10141. map(options?: MapOptions): Object;
  10142. sourceAndMap(options?: MapOptions): { source: string | Buffer; map: Object };
  10143. updateHash(hash: Hash): void;
  10144. source(): string | Buffer;
  10145. buffer(): Buffer;
  10146. }
  10147. declare interface SourceLike {
  10148. source(): string | Buffer;
  10149. }
  10150. declare interface SourceMap {
  10151. version: number;
  10152. sources: string[];
  10153. mappings: string;
  10154. file?: string;
  10155. sourceRoot?: string;
  10156. sourcesContent?: string[];
  10157. names?: string[];
  10158. }
  10159. declare class SourceMapDevToolPlugin {
  10160. constructor(options?: SourceMapDevToolPluginOptions);
  10161. sourceMapFilename: string | false;
  10162. sourceMappingURLComment: string | false;
  10163. moduleFilenameTemplate: string | Function;
  10164. fallbackModuleFilenameTemplate: string | Function;
  10165. namespace: string;
  10166. options: SourceMapDevToolPluginOptions;
  10167. /**
  10168. * Apply the plugin
  10169. */
  10170. apply(compiler: Compiler): void;
  10171. }
  10172. declare interface SourceMapDevToolPluginOptions {
  10173. /**
  10174. * Appends the given value to the original asset. Usually the #sourceMappingURL comment. [url] is replaced with a URL to the source map file. false disables the appending.
  10175. */
  10176. append?: null | string | false;
  10177. /**
  10178. * Indicates whether column mappings should be used (defaults to true).
  10179. */
  10180. columns?: boolean;
  10181. /**
  10182. * Exclude modules that match the given value from source map generation.
  10183. */
  10184. exclude?: string | RegExp | Rule[];
  10185. /**
  10186. * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap used only if 'moduleFilenameTemplate' would result in a conflict.
  10187. */
  10188. fallbackModuleFilenameTemplate?: string | Function;
  10189. /**
  10190. * Path prefix to which the [file] placeholder is relative to.
  10191. */
  10192. fileContext?: string;
  10193. /**
  10194. * Defines the output filename of the SourceMap (will be inlined if no value is provided).
  10195. */
  10196. filename?: null | string | false;
  10197. /**
  10198. * Include source maps for module paths that match the given value.
  10199. */
  10200. include?: string | RegExp | Rule[];
  10201. /**
  10202. * Indicates whether SourceMaps from loaders should be used (defaults to true).
  10203. */
  10204. module?: boolean;
  10205. /**
  10206. * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap.
  10207. */
  10208. moduleFilenameTemplate?: string | Function;
  10209. /**
  10210. * Namespace prefix to allow multiple webpack roots in the devtools.
  10211. */
  10212. namespace?: string;
  10213. /**
  10214. * Omit the 'sourceContents' array from the SourceMap.
  10215. */
  10216. noSources?: boolean;
  10217. /**
  10218. * Provide a custom public path for the SourceMapping comment.
  10219. */
  10220. publicPath?: string;
  10221. /**
  10222. * Provide a custom value for the 'sourceRoot' property in the SourceMap.
  10223. */
  10224. sourceRoot?: string;
  10225. /**
  10226. * Include source maps for modules based on their extension (defaults to .js and .css).
  10227. */
  10228. test?: string | RegExp | Rule[];
  10229. }
  10230. declare class SourceMapSource extends Source {
  10231. constructor(
  10232. source: string | Buffer,
  10233. name: string,
  10234. sourceMap: string | Object | Buffer,
  10235. originalSource?: string | Buffer,
  10236. innerSourceMap?: string | Object | Buffer,
  10237. removeOriginalSource?: boolean
  10238. );
  10239. getArgsAsBuffers(): [
  10240. Buffer,
  10241. string,
  10242. Buffer,
  10243. undefined | Buffer,
  10244. undefined | Buffer,
  10245. boolean
  10246. ];
  10247. }
  10248. declare interface SourcePosition {
  10249. line: number;
  10250. column?: number;
  10251. }
  10252. declare interface SplitChunksOptions {
  10253. chunksFilter: (chunk: Chunk) => boolean;
  10254. defaultSizeTypes: string[];
  10255. minSize: SplitChunksSizes;
  10256. minSizeReduction: SplitChunksSizes;
  10257. minRemainingSize: SplitChunksSizes;
  10258. enforceSizeThreshold: SplitChunksSizes;
  10259. maxInitialSize: SplitChunksSizes;
  10260. maxAsyncSize: SplitChunksSizes;
  10261. minChunks: number;
  10262. maxAsyncRequests: number;
  10263. maxInitialRequests: number;
  10264. hidePathInfo: boolean;
  10265. filename: string | ((arg0: PathData, arg1?: AssetInfo) => string);
  10266. automaticNameDelimiter: string;
  10267. getCacheGroups: (
  10268. module: Module,
  10269. context: CacheGroupsContext
  10270. ) => CacheGroupSource[];
  10271. getName: (
  10272. module?: Module,
  10273. chunks?: Chunk[],
  10274. key?: string
  10275. ) => undefined | string;
  10276. usedExports: boolean;
  10277. fallbackCacheGroup: FallbackCacheGroup;
  10278. }
  10279. declare class SplitChunksPlugin {
  10280. constructor(options?: OptimizationSplitChunksOptions);
  10281. options: SplitChunksOptions;
  10282. /**
  10283. * Apply the plugin
  10284. */
  10285. apply(compiler: Compiler): void;
  10286. }
  10287. declare interface SplitChunksSizes {
  10288. [index: string]: number;
  10289. }
  10290. declare abstract class StackedMap<K, V> {
  10291. map: Map<K, InternalCell<V>>;
  10292. stack: Map<K, InternalCell<V>>[];
  10293. set(item: K, value: V): void;
  10294. delete(item: K): void;
  10295. has(item: K): boolean;
  10296. get(item: K): Cell<V>;
  10297. asArray(): K[];
  10298. asSet(): Set<K>;
  10299. asPairArray(): [K, Cell<V>][];
  10300. asMap(): Map<K, Cell<V>>;
  10301. readonly size: number;
  10302. createChild(): StackedMap<K, V>;
  10303. }
  10304. type StartupRenderContext = RenderContext & { inlined: boolean };
  10305. type Statement =
  10306. | FunctionDeclaration
  10307. | VariableDeclaration
  10308. | ClassDeclaration
  10309. | ExpressionStatement
  10310. | BlockStatement
  10311. | StaticBlock
  10312. | EmptyStatement
  10313. | DebuggerStatement
  10314. | WithStatement
  10315. | ReturnStatement
  10316. | LabeledStatement
  10317. | BreakStatement
  10318. | ContinueStatement
  10319. | IfStatement
  10320. | SwitchStatement
  10321. | ThrowStatement
  10322. | TryStatement
  10323. | WhileStatement
  10324. | DoWhileStatement
  10325. | ForStatement
  10326. | ForInStatement
  10327. | ForOfStatement;
  10328. declare class Stats {
  10329. constructor(compilation: Compilation);
  10330. compilation: Compilation;
  10331. readonly hash?: string;
  10332. readonly startTime: any;
  10333. readonly endTime: any;
  10334. hasWarnings(): boolean;
  10335. hasErrors(): boolean;
  10336. toJson(options?: string | StatsOptions): StatsCompilation;
  10337. toString(options?: any): string;
  10338. }
  10339. type StatsAsset = KnownStatsAsset & Record<string, any>;
  10340. type StatsChunk = KnownStatsChunk & Record<string, any>;
  10341. type StatsChunkGroup = KnownStatsChunkGroup & Record<string, any>;
  10342. type StatsChunkOrigin = KnownStatsChunkOrigin & Record<string, any>;
  10343. type StatsCompilation = KnownStatsCompilation & Record<string, any>;
  10344. type StatsError = KnownStatsError & Record<string, any>;
  10345. declare abstract class StatsFactory {
  10346. hooks: Readonly<{
  10347. extract: HookMap<SyncBailHook<[Object, any, StatsFactoryContext], any>>;
  10348. filter: HookMap<
  10349. SyncBailHook<[any, StatsFactoryContext, number, number], any>
  10350. >;
  10351. sort: HookMap<
  10352. SyncBailHook<
  10353. [((arg0?: any, arg1?: any) => number)[], StatsFactoryContext],
  10354. any
  10355. >
  10356. >;
  10357. filterSorted: HookMap<
  10358. SyncBailHook<[any, StatsFactoryContext, number, number], any>
  10359. >;
  10360. groupResults: HookMap<
  10361. SyncBailHook<[GroupConfig[], StatsFactoryContext], any>
  10362. >;
  10363. sortResults: HookMap<
  10364. SyncBailHook<
  10365. [((arg0?: any, arg1?: any) => number)[], StatsFactoryContext],
  10366. any
  10367. >
  10368. >;
  10369. filterResults: HookMap<
  10370. SyncBailHook<[any, StatsFactoryContext, number, number], any>
  10371. >;
  10372. merge: HookMap<SyncBailHook<[any[], StatsFactoryContext], any>>;
  10373. result: HookMap<SyncBailHook<[any[], StatsFactoryContext], any>>;
  10374. getItemName: HookMap<SyncBailHook<[any, StatsFactoryContext], any>>;
  10375. getItemFactory: HookMap<SyncBailHook<[any, StatsFactoryContext], any>>;
  10376. }>;
  10377. create(
  10378. type: string,
  10379. data: any,
  10380. baseContext: Omit<StatsFactoryContext, "type">
  10381. ): any;
  10382. }
  10383. type StatsFactoryContext = KnownStatsFactoryContext & Record<string, any>;
  10384. type StatsLogging = KnownStatsLogging & Record<string, any>;
  10385. type StatsLoggingEntry = KnownStatsLoggingEntry & Record<string, any>;
  10386. type StatsModule = KnownStatsModule & Record<string, any>;
  10387. type StatsModuleIssuer = KnownStatsModuleIssuer & Record<string, any>;
  10388. type StatsModuleReason = KnownStatsModuleReason & Record<string, any>;
  10389. type StatsModuleTraceDependency = KnownStatsModuleTraceDependency &
  10390. Record<string, any>;
  10391. type StatsModuleTraceItem = KnownStatsModuleTraceItem & Record<string, any>;
  10392. /**
  10393. * Stats options object.
  10394. */
  10395. declare interface StatsOptions {
  10396. /**
  10397. * Fallback value for stats options when an option is not defined (has precedence over local webpack defaults).
  10398. */
  10399. all?: boolean;
  10400. /**
  10401. * Add assets information.
  10402. */
  10403. assets?: boolean;
  10404. /**
  10405. * Sort the assets by that field.
  10406. */
  10407. assetsSort?: string;
  10408. /**
  10409. * Space to display assets (groups will be collapsed to fit this space).
  10410. */
  10411. assetsSpace?: number;
  10412. /**
  10413. * Add built at time information.
  10414. */
  10415. builtAt?: boolean;
  10416. /**
  10417. * Add information about cached (not built) modules (deprecated: use 'cachedModules' instead).
  10418. */
  10419. cached?: boolean;
  10420. /**
  10421. * Show cached assets (setting this to `false` only shows emitted files).
  10422. */
  10423. cachedAssets?: boolean;
  10424. /**
  10425. * Add information about cached (not built) modules.
  10426. */
  10427. cachedModules?: boolean;
  10428. /**
  10429. * Add children information.
  10430. */
  10431. children?: boolean;
  10432. /**
  10433. * Display auxiliary assets in chunk groups.
  10434. */
  10435. chunkGroupAuxiliary?: boolean;
  10436. /**
  10437. * Display children of chunk groups.
  10438. */
  10439. chunkGroupChildren?: boolean;
  10440. /**
  10441. * Limit of assets displayed in chunk groups.
  10442. */
  10443. chunkGroupMaxAssets?: number;
  10444. /**
  10445. * Display all chunk groups with the corresponding bundles.
  10446. */
  10447. chunkGroups?: boolean;
  10448. /**
  10449. * Add built modules information to chunk information.
  10450. */
  10451. chunkModules?: boolean;
  10452. /**
  10453. * Space to display chunk modules (groups will be collapsed to fit this space, value is in number of modules/group).
  10454. */
  10455. chunkModulesSpace?: number;
  10456. /**
  10457. * Add the origins of chunks and chunk merging info.
  10458. */
  10459. chunkOrigins?: boolean;
  10460. /**
  10461. * Add information about parent, children and sibling chunks to chunk information.
  10462. */
  10463. chunkRelations?: boolean;
  10464. /**
  10465. * Add chunk information.
  10466. */
  10467. chunks?: boolean;
  10468. /**
  10469. * Sort the chunks by that field.
  10470. */
  10471. chunksSort?: string;
  10472. /**
  10473. * Enables/Disables colorful output.
  10474. */
  10475. colors?:
  10476. | boolean
  10477. | {
  10478. /**
  10479. * Custom color for bold text.
  10480. */
  10481. bold?: string;
  10482. /**
  10483. * Custom color for cyan text.
  10484. */
  10485. cyan?: string;
  10486. /**
  10487. * Custom color for green text.
  10488. */
  10489. green?: string;
  10490. /**
  10491. * Custom color for magenta text.
  10492. */
  10493. magenta?: string;
  10494. /**
  10495. * Custom color for red text.
  10496. */
  10497. red?: string;
  10498. /**
  10499. * Custom color for yellow text.
  10500. */
  10501. yellow?: string;
  10502. };
  10503. /**
  10504. * Context directory for request shortening.
  10505. */
  10506. context?: string;
  10507. /**
  10508. * Show chunk modules that are dependencies of other modules of the chunk.
  10509. */
  10510. dependentModules?: boolean;
  10511. /**
  10512. * Add module depth in module graph.
  10513. */
  10514. depth?: boolean;
  10515. /**
  10516. * Display the entry points with the corresponding bundles.
  10517. */
  10518. entrypoints?: boolean | "auto";
  10519. /**
  10520. * Add --env information.
  10521. */
  10522. env?: boolean;
  10523. /**
  10524. * Add details to errors (like resolving log).
  10525. */
  10526. errorDetails?: boolean | "auto";
  10527. /**
  10528. * Add internal stack trace to errors.
  10529. */
  10530. errorStack?: boolean;
  10531. /**
  10532. * Add errors.
  10533. */
  10534. errors?: boolean;
  10535. /**
  10536. * Add errors count.
  10537. */
  10538. errorsCount?: boolean;
  10539. /**
  10540. * Please use excludeModules instead.
  10541. */
  10542. exclude?:
  10543. | string
  10544. | boolean
  10545. | RegExp
  10546. | ModuleFilterItemTypes[]
  10547. | ((
  10548. name: string,
  10549. module: StatsModule,
  10550. type: "module" | "chunk" | "root-of-chunk" | "nested"
  10551. ) => boolean);
  10552. /**
  10553. * Suppress assets that match the specified filters. Filters can be Strings, RegExps or Functions.
  10554. */
  10555. excludeAssets?:
  10556. | string
  10557. | RegExp
  10558. | AssetFilterItemTypes[]
  10559. | ((name: string, asset: StatsAsset) => boolean);
  10560. /**
  10561. * Suppress modules that match the specified filters. Filters can be Strings, RegExps, Booleans or Functions.
  10562. */
  10563. excludeModules?:
  10564. | string
  10565. | boolean
  10566. | RegExp
  10567. | ModuleFilterItemTypes[]
  10568. | ((
  10569. name: string,
  10570. module: StatsModule,
  10571. type: "module" | "chunk" | "root-of-chunk" | "nested"
  10572. ) => boolean);
  10573. /**
  10574. * Group assets by how their are related to chunks.
  10575. */
  10576. groupAssetsByChunk?: boolean;
  10577. /**
  10578. * Group assets by their status (emitted, compared for emit or cached).
  10579. */
  10580. groupAssetsByEmitStatus?: boolean;
  10581. /**
  10582. * Group assets by their extension.
  10583. */
  10584. groupAssetsByExtension?: boolean;
  10585. /**
  10586. * Group assets by their asset info (immutable, development, hotModuleReplacement, etc).
  10587. */
  10588. groupAssetsByInfo?: boolean;
  10589. /**
  10590. * Group assets by their path.
  10591. */
  10592. groupAssetsByPath?: boolean;
  10593. /**
  10594. * Group modules by their attributes (errors, warnings, assets, optional, orphan, or dependent).
  10595. */
  10596. groupModulesByAttributes?: boolean;
  10597. /**
  10598. * Group modules by their status (cached or built and cacheable).
  10599. */
  10600. groupModulesByCacheStatus?: boolean;
  10601. /**
  10602. * Group modules by their extension.
  10603. */
  10604. groupModulesByExtension?: boolean;
  10605. /**
  10606. * Group modules by their layer.
  10607. */
  10608. groupModulesByLayer?: boolean;
  10609. /**
  10610. * Group modules by their path.
  10611. */
  10612. groupModulesByPath?: boolean;
  10613. /**
  10614. * Group modules by their type.
  10615. */
  10616. groupModulesByType?: boolean;
  10617. /**
  10618. * Group reasons by their origin module.
  10619. */
  10620. groupReasonsByOrigin?: boolean;
  10621. /**
  10622. * Add the hash of the compilation.
  10623. */
  10624. hash?: boolean;
  10625. /**
  10626. * Add ids.
  10627. */
  10628. ids?: boolean;
  10629. /**
  10630. * Add logging output.
  10631. */
  10632. logging?: boolean | "none" | "error" | "warn" | "info" | "log" | "verbose";
  10633. /**
  10634. * Include debug logging of specified loggers (i. e. for plugins or loaders). Filters can be Strings, RegExps or Functions.
  10635. */
  10636. loggingDebug?:
  10637. | string
  10638. | boolean
  10639. | RegExp
  10640. | FilterItemTypes[]
  10641. | ((value: string) => boolean);
  10642. /**
  10643. * Add stack traces to logging output.
  10644. */
  10645. loggingTrace?: boolean;
  10646. /**
  10647. * Add information about assets inside modules.
  10648. */
  10649. moduleAssets?: boolean;
  10650. /**
  10651. * Add dependencies and origin of warnings/errors.
  10652. */
  10653. moduleTrace?: boolean;
  10654. /**
  10655. * Add built modules information.
  10656. */
  10657. modules?: boolean;
  10658. /**
  10659. * Sort the modules by that field.
  10660. */
  10661. modulesSort?: string;
  10662. /**
  10663. * Space to display modules (groups will be collapsed to fit this space, value is in number of modules/groups).
  10664. */
  10665. modulesSpace?: number;
  10666. /**
  10667. * Add information about modules nested in other modules (like with module concatenation).
  10668. */
  10669. nestedModules?: boolean;
  10670. /**
  10671. * Space to display modules nested within other modules (groups will be collapsed to fit this space, value is in number of modules/group).
  10672. */
  10673. nestedModulesSpace?: number;
  10674. /**
  10675. * Show reasons why optimization bailed out for modules.
  10676. */
  10677. optimizationBailout?: boolean;
  10678. /**
  10679. * Add information about orphan modules.
  10680. */
  10681. orphanModules?: boolean;
  10682. /**
  10683. * Add output path information.
  10684. */
  10685. outputPath?: boolean;
  10686. /**
  10687. * Add performance hint flags.
  10688. */
  10689. performance?: boolean;
  10690. /**
  10691. * Preset for the default values.
  10692. */
  10693. preset?: string | boolean;
  10694. /**
  10695. * Show exports provided by modules.
  10696. */
  10697. providedExports?: boolean;
  10698. /**
  10699. * Add public path information.
  10700. */
  10701. publicPath?: boolean;
  10702. /**
  10703. * Add information about the reasons why modules are included.
  10704. */
  10705. reasons?: boolean;
  10706. /**
  10707. * Space to display reasons (groups will be collapsed to fit this space).
  10708. */
  10709. reasonsSpace?: number;
  10710. /**
  10711. * Add information about assets that are related to other assets (like SourceMaps for assets).
  10712. */
  10713. relatedAssets?: boolean;
  10714. /**
  10715. * Add information about runtime modules (deprecated: use 'runtimeModules' instead).
  10716. */
  10717. runtime?: boolean;
  10718. /**
  10719. * Add information about runtime modules.
  10720. */
  10721. runtimeModules?: boolean;
  10722. /**
  10723. * Add the source code of modules.
  10724. */
  10725. source?: boolean;
  10726. /**
  10727. * Add timing information.
  10728. */
  10729. timings?: boolean;
  10730. /**
  10731. * Show exports used by modules.
  10732. */
  10733. usedExports?: boolean;
  10734. /**
  10735. * Add webpack version information.
  10736. */
  10737. version?: boolean;
  10738. /**
  10739. * Add warnings.
  10740. */
  10741. warnings?: boolean;
  10742. /**
  10743. * Add warnings count.
  10744. */
  10745. warningsCount?: boolean;
  10746. /**
  10747. * Suppress listing warnings that match the specified filters (they will still be counted). Filters can be Strings, RegExps or Functions.
  10748. */
  10749. warningsFilter?:
  10750. | string
  10751. | RegExp
  10752. | WarningFilterItemTypes[]
  10753. | ((warning: StatsError, value: string) => boolean);
  10754. }
  10755. declare abstract class StatsPrinter {
  10756. hooks: Readonly<{
  10757. sortElements: HookMap<SyncBailHook<[string[], StatsPrinterContext], true>>;
  10758. printElements: HookMap<
  10759. SyncBailHook<[PrintedElement[], StatsPrinterContext], string>
  10760. >;
  10761. sortItems: HookMap<SyncBailHook<[any[], StatsPrinterContext], true>>;
  10762. getItemName: HookMap<SyncBailHook<[any, StatsPrinterContext], string>>;
  10763. printItems: HookMap<SyncBailHook<[string[], StatsPrinterContext], string>>;
  10764. print: HookMap<SyncBailHook<[{}, StatsPrinterContext], string>>;
  10765. result: HookMap<SyncWaterfallHook<[string, StatsPrinterContext]>>;
  10766. }>;
  10767. print(type: string, object: Object, baseContext?: Object): string;
  10768. }
  10769. type StatsPrinterContext = KnownStatsPrinterContext & Record<string, any>;
  10770. type StatsProfile = KnownStatsProfile & Record<string, any>;
  10771. type StatsValue =
  10772. | boolean
  10773. | StatsOptions
  10774. | "none"
  10775. | "verbose"
  10776. | "summary"
  10777. | "errors-only"
  10778. | "errors-warnings"
  10779. | "minimal"
  10780. | "normal"
  10781. | "detailed";
  10782. declare class SyncModuleIdsPlugin {
  10783. constructor(__0: {
  10784. /**
  10785. * path to file
  10786. */
  10787. path: string;
  10788. /**
  10789. * context for module names
  10790. */
  10791. context?: string;
  10792. /**
  10793. * selector for modules
  10794. */
  10795. test: (arg0: Module) => boolean;
  10796. /**
  10797. * operation mode (defaults to merge)
  10798. */
  10799. mode?: "read" | "create" | "merge" | "update";
  10800. });
  10801. /**
  10802. * Apply the plugin
  10803. */
  10804. apply(compiler: Compiler): void;
  10805. }
  10806. declare interface SyntheticDependencyLocation {
  10807. name: string;
  10808. index?: number;
  10809. }
  10810. declare const TOMBSTONE: unique symbol;
  10811. declare const TRANSITIVE: unique symbol;
  10812. declare const TRANSITIVE_ONLY: unique symbol;
  10813. declare interface TagInfo {
  10814. tag: any;
  10815. data: any;
  10816. next?: TagInfo;
  10817. }
  10818. declare class Template {
  10819. constructor();
  10820. static getFunctionContent(fn: Function): string;
  10821. static toIdentifier(str: string): string;
  10822. static toComment(str: string): string;
  10823. static toNormalComment(str: string): string;
  10824. static toPath(str: string): string;
  10825. static numberToIdentifier(n: number): string;
  10826. static numberToIdentifierContinuation(n: number): string;
  10827. static indent(s: string | string[]): string;
  10828. static prefix(s: string | string[], prefix: string): string;
  10829. static asString(str: string | string[]): string;
  10830. static getModulesArrayBounds(modules: WithId[]): false | [number, number];
  10831. static renderChunkModules(
  10832. renderContext: ChunkRenderContext,
  10833. modules: Module[],
  10834. renderModule: (arg0: Module) => Source,
  10835. prefix?: string
  10836. ): Source;
  10837. static renderRuntimeModules(
  10838. runtimeModules: RuntimeModule[],
  10839. renderContext: RenderContext & {
  10840. codeGenerationResults?: CodeGenerationResults;
  10841. }
  10842. ): Source;
  10843. static renderChunkRuntimeModules(
  10844. runtimeModules: RuntimeModule[],
  10845. renderContext: RenderContext
  10846. ): Source;
  10847. static NUMBER_OF_IDENTIFIER_START_CHARS: number;
  10848. static NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS: number;
  10849. }
  10850. declare interface TimestampAndHash {
  10851. safeTime: number;
  10852. timestamp?: number;
  10853. hash: string;
  10854. }
  10855. declare class TopLevelSymbol {
  10856. constructor(name: string);
  10857. name: string;
  10858. }
  10859. /**
  10860. * Use a Trusted Types policy to create urls for chunks.
  10861. */
  10862. declare interface TrustedTypes {
  10863. /**
  10864. * The name of the Trusted Types policy created by webpack to serve bundle chunks.
  10865. */
  10866. policyName?: string;
  10867. }
  10868. declare const UNDEFINED_MARKER: unique symbol;
  10869. declare interface UpdateHashContextDependency {
  10870. chunkGraph: ChunkGraph;
  10871. runtime: RuntimeSpec;
  10872. runtimeTemplate?: RuntimeTemplate;
  10873. }
  10874. declare interface UpdateHashContextGenerator {
  10875. /**
  10876. * the module
  10877. */
  10878. module: NormalModule;
  10879. chunkGraph: ChunkGraph;
  10880. runtime: RuntimeSpec;
  10881. runtimeTemplate?: RuntimeTemplate;
  10882. }
  10883. type UsageStateType = 0 | 1 | 2 | 3 | 4;
  10884. declare interface UserResolveOptions {
  10885. /**
  10886. * A list of module alias configurations or an object which maps key to value
  10887. */
  10888. alias?: AliasOption[] | AliasOptions;
  10889. /**
  10890. * A list of module alias configurations or an object which maps key to value, applied only after modules option
  10891. */
  10892. fallback?: AliasOption[] | AliasOptions;
  10893. /**
  10894. * A list of alias fields in description files
  10895. */
  10896. aliasFields?: (string | string[])[];
  10897. /**
  10898. * A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties.
  10899. */
  10900. cachePredicate?: (arg0: ResolveRequest) => boolean;
  10901. /**
  10902. * Whether or not the unsafeCache should include request context as part of the cache key.
  10903. */
  10904. cacheWithContext?: boolean;
  10905. /**
  10906. * A list of description files to read from
  10907. */
  10908. descriptionFiles?: string[];
  10909. /**
  10910. * A list of exports field condition names.
  10911. */
  10912. conditionNames?: string[];
  10913. /**
  10914. * Enforce that a extension from extensions must be used
  10915. */
  10916. enforceExtension?: boolean;
  10917. /**
  10918. * A list of exports fields in description files
  10919. */
  10920. exportsFields?: (string | string[])[];
  10921. /**
  10922. * A list of imports fields in description files
  10923. */
  10924. importsFields?: (string | string[])[];
  10925. /**
  10926. * A list of extensions which should be tried for files
  10927. */
  10928. extensions?: string[];
  10929. /**
  10930. * The file system which should be used
  10931. */
  10932. fileSystem: FileSystem;
  10933. /**
  10934. * Use this cache object to unsafely cache the successful requests
  10935. */
  10936. unsafeCache?: boolean | object;
  10937. /**
  10938. * Resolve symlinks to their symlinked location
  10939. */
  10940. symlinks?: boolean;
  10941. /**
  10942. * A prepared Resolver to which the plugins are attached
  10943. */
  10944. resolver?: Resolver;
  10945. /**
  10946. * A list of directories to resolve modules from, can be absolute path or folder name
  10947. */
  10948. modules?: string | string[];
  10949. /**
  10950. * A list of main fields in description files
  10951. */
  10952. mainFields?: (
  10953. | string
  10954. | string[]
  10955. | { name: string | string[]; forceRelative: boolean }
  10956. )[];
  10957. /**
  10958. * A list of main files in directories
  10959. */
  10960. mainFiles?: string[];
  10961. /**
  10962. * A list of additional resolve plugins which should be applied
  10963. */
  10964. plugins?: Plugin[];
  10965. /**
  10966. * A PnP API that should be used - null is "never", undefined is "auto"
  10967. */
  10968. pnpApi?: null | PnpApiImpl;
  10969. /**
  10970. * A list of root paths
  10971. */
  10972. roots?: string[];
  10973. /**
  10974. * The request is already fully specified and no extensions or directories are resolved for it
  10975. */
  10976. fullySpecified?: boolean;
  10977. /**
  10978. * Resolve to a context instead of a file
  10979. */
  10980. resolveToContext?: boolean;
  10981. /**
  10982. * A list of resolve restrictions
  10983. */
  10984. restrictions?: (string | RegExp)[];
  10985. /**
  10986. * Use only the sync constraints of the file system calls
  10987. */
  10988. useSyncFileSystemCalls?: boolean;
  10989. /**
  10990. * Prefer to resolve module requests as relative requests before falling back to modules
  10991. */
  10992. preferRelative?: boolean;
  10993. /**
  10994. * Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots
  10995. */
  10996. preferAbsolute?: boolean;
  10997. }
  10998. declare abstract class VariableInfo {
  10999. declaredScope: ScopeInfo;
  11000. freeName: string | true;
  11001. tagInfo?: TagInfo;
  11002. }
  11003. declare interface VariableInfoInterface {
  11004. declaredScope: ScopeInfo;
  11005. freeName: string | true;
  11006. tagInfo?: TagInfo;
  11007. }
  11008. type WarningFilterItemTypes =
  11009. | string
  11010. | RegExp
  11011. | ((warning: StatsError, value: string) => boolean);
  11012. declare interface WatchFileSystem {
  11013. watch: (
  11014. files: Iterable<string>,
  11015. directories: Iterable<string>,
  11016. missing: Iterable<string>,
  11017. startTime: number,
  11018. options: WatchOptions,
  11019. callback: (
  11020. arg0: undefined | Error,
  11021. arg1: Map<string, FileSystemInfoEntry | "ignore">,
  11022. arg2: Map<string, FileSystemInfoEntry | "ignore">,
  11023. arg3: Set<string>,
  11024. arg4: Set<string>
  11025. ) => void,
  11026. callbackUndelayed: (arg0: string, arg1: number) => void
  11027. ) => Watcher;
  11028. }
  11029. declare class WatchIgnorePlugin {
  11030. constructor(options: WatchIgnorePluginOptions);
  11031. paths: (string | RegExp)[];
  11032. /**
  11033. * Apply the plugin
  11034. */
  11035. apply(compiler: Compiler): void;
  11036. }
  11037. declare interface WatchIgnorePluginOptions {
  11038. /**
  11039. * A list of RegExps or absolute paths to directories or files that should be ignored.
  11040. */
  11041. paths: (string | RegExp)[];
  11042. }
  11043. /**
  11044. * Options for the watcher.
  11045. */
  11046. declare interface WatchOptions {
  11047. /**
  11048. * Delay the rebuilt after the first change. Value is a time in ms.
  11049. */
  11050. aggregateTimeout?: number;
  11051. /**
  11052. * Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks ('resolve.symlinks').
  11053. */
  11054. followSymlinks?: boolean;
  11055. /**
  11056. * Ignore some files from watching (glob pattern or regexp).
  11057. */
  11058. ignored?: string | RegExp | string[];
  11059. /**
  11060. * Enable polling mode for watching.
  11061. */
  11062. poll?: number | boolean;
  11063. /**
  11064. * Stop watching when stdin stream has ended.
  11065. */
  11066. stdin?: boolean;
  11067. }
  11068. declare interface Watcher {
  11069. /**
  11070. * closes the watcher and all underlying file watchers
  11071. */
  11072. close: () => void;
  11073. /**
  11074. * closes the watcher, but keeps underlying file watchers alive until the next watch call
  11075. */
  11076. pause: () => void;
  11077. /**
  11078. * get current aggregated changes that have not yet send to callback
  11079. */
  11080. getAggregatedChanges?: () => Set<string>;
  11081. /**
  11082. * get current aggregated removals that have not yet send to callback
  11083. */
  11084. getAggregatedRemovals?: () => Set<string>;
  11085. /**
  11086. * get info about files
  11087. */
  11088. getFileTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
  11089. /**
  11090. * get info about directories
  11091. */
  11092. getContextTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
  11093. /**
  11094. * get info about timestamps and changes
  11095. */
  11096. getInfo?: () => WatcherInfo;
  11097. }
  11098. declare interface WatcherInfo {
  11099. /**
  11100. * get current aggregated changes that have not yet send to callback
  11101. */
  11102. changes: Set<string>;
  11103. /**
  11104. * get current aggregated removals that have not yet send to callback
  11105. */
  11106. removals: Set<string>;
  11107. /**
  11108. * get info about files
  11109. */
  11110. fileTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
  11111. /**
  11112. * get info about directories
  11113. */
  11114. contextTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
  11115. }
  11116. declare abstract class Watching {
  11117. startTime: null | number;
  11118. invalid: boolean;
  11119. handler: CallbackFunction<Stats>;
  11120. callbacks: CallbackFunction<void>[];
  11121. closed: boolean;
  11122. suspended: boolean;
  11123. blocked: boolean;
  11124. watchOptions: {
  11125. /**
  11126. * Delay the rebuilt after the first change. Value is a time in ms.
  11127. */
  11128. aggregateTimeout?: number;
  11129. /**
  11130. * Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks ('resolve.symlinks').
  11131. */
  11132. followSymlinks?: boolean;
  11133. /**
  11134. * Ignore some files from watching (glob pattern or regexp).
  11135. */
  11136. ignored?: string | RegExp | string[];
  11137. /**
  11138. * Enable polling mode for watching.
  11139. */
  11140. poll?: number | boolean;
  11141. /**
  11142. * Stop watching when stdin stream has ended.
  11143. */
  11144. stdin?: boolean;
  11145. };
  11146. compiler: Compiler;
  11147. running: boolean;
  11148. watcher?: null | Watcher;
  11149. pausedWatcher?: null | Watcher;
  11150. lastWatcherStartTime?: number;
  11151. watch(
  11152. files: Iterable<string>,
  11153. dirs: Iterable<string>,
  11154. missing: Iterable<string>
  11155. ): void;
  11156. invalidate(callback?: CallbackFunction<void>): void;
  11157. suspend(): void;
  11158. resume(): void;
  11159. close(callback: CallbackFunction<void>): void;
  11160. }
  11161. declare abstract class WeakTupleMap<T extends any[], V> {
  11162. set(...args: [T, ...V[]]): void;
  11163. has(...args: T): boolean;
  11164. get(...args: T): V;
  11165. provide(...args: [T, ...(() => V)[]]): V;
  11166. delete(...args: T): void;
  11167. clear(): void;
  11168. }
  11169. declare interface WebAssemblyRenderContext {
  11170. /**
  11171. * the chunk
  11172. */
  11173. chunk: Chunk;
  11174. /**
  11175. * the dependency templates
  11176. */
  11177. dependencyTemplates: DependencyTemplates;
  11178. /**
  11179. * the runtime template
  11180. */
  11181. runtimeTemplate: RuntimeTemplate;
  11182. /**
  11183. * the module graph
  11184. */
  11185. moduleGraph: ModuleGraph;
  11186. /**
  11187. * the chunk graph
  11188. */
  11189. chunkGraph: ChunkGraph;
  11190. /**
  11191. * results of code generation
  11192. */
  11193. codeGenerationResults: CodeGenerationResults;
  11194. }
  11195. declare class WebWorkerTemplatePlugin {
  11196. constructor();
  11197. /**
  11198. * Apply the plugin
  11199. */
  11200. apply(compiler: Compiler): void;
  11201. }
  11202. declare class WebpackError extends Error {
  11203. /**
  11204. * Creates an instance of WebpackError.
  11205. */
  11206. constructor(message?: string);
  11207. details: any;
  11208. module: Module;
  11209. loc: DependencyLocation;
  11210. hideStack: boolean;
  11211. chunk: Chunk;
  11212. file: string;
  11213. serialize(__0: { write: any }): void;
  11214. deserialize(__0: { read: any }): void;
  11215. /**
  11216. * Create .stack property on a target object
  11217. */
  11218. static captureStackTrace(
  11219. targetObject: object,
  11220. constructorOpt?: Function
  11221. ): void;
  11222. /**
  11223. * Optional override for formatting stack traces
  11224. */
  11225. static prepareStackTrace?: (
  11226. err: Error,
  11227. stackTraces: NodeJS.CallSite[]
  11228. ) => any;
  11229. static stackTraceLimit: number;
  11230. }
  11231. declare abstract class WebpackLogger {
  11232. getChildLogger: (arg0: string | (() => string)) => WebpackLogger;
  11233. error(...args: any[]): void;
  11234. warn(...args: any[]): void;
  11235. info(...args: any[]): void;
  11236. log(...args: any[]): void;
  11237. debug(...args: any[]): void;
  11238. assert(assertion: any, ...args: any[]): void;
  11239. trace(): void;
  11240. clear(): void;
  11241. status(...args: any[]): void;
  11242. group(...args: any[]): void;
  11243. groupCollapsed(...args: any[]): void;
  11244. groupEnd(...args: any[]): void;
  11245. profile(label?: any): void;
  11246. profileEnd(label?: any): void;
  11247. time(label?: any): void;
  11248. timeLog(label?: any): void;
  11249. timeEnd(label?: any): void;
  11250. timeAggregate(label?: any): void;
  11251. timeAggregateEnd(label?: any): void;
  11252. }
  11253. declare class WebpackOptionsApply extends OptionsApply {
  11254. constructor();
  11255. }
  11256. declare class WebpackOptionsDefaulter {
  11257. constructor();
  11258. process(options?: any): any;
  11259. }
  11260. /**
  11261. * Normalized webpack options object.
  11262. */
  11263. declare interface WebpackOptionsNormalized {
  11264. /**
  11265. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  11266. */
  11267. amd?: false | { [index: string]: any };
  11268. /**
  11269. * Report the first error as a hard error instead of tolerating it.
  11270. */
  11271. bail?: boolean;
  11272. /**
  11273. * Cache generated modules and chunks to improve performance for multiple incremental builds.
  11274. */
  11275. cache: CacheOptionsNormalized;
  11276. /**
  11277. * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.
  11278. */
  11279. context?: string;
  11280. /**
  11281. * References to other configurations to depend on.
  11282. */
  11283. dependencies?: string[];
  11284. /**
  11285. * Options for the webpack-dev-server.
  11286. */
  11287. devServer?: DevServer;
  11288. /**
  11289. * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
  11290. */
  11291. devtool?: string | false;
  11292. /**
  11293. * The entry point(s) of the compilation.
  11294. */
  11295. entry: EntryNormalized;
  11296. /**
  11297. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  11298. */
  11299. experiments: ExperimentsNormalized;
  11300. /**
  11301. * Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`.
  11302. */
  11303. externals: Externals;
  11304. /**
  11305. * Enable presets of externals for specific targets.
  11306. */
  11307. externalsPresets: ExternalsPresets;
  11308. /**
  11309. * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
  11310. */
  11311. externalsType?:
  11312. | "import"
  11313. | "var"
  11314. | "module"
  11315. | "assign"
  11316. | "this"
  11317. | "window"
  11318. | "self"
  11319. | "global"
  11320. | "commonjs"
  11321. | "commonjs2"
  11322. | "commonjs-module"
  11323. | "commonjs-static"
  11324. | "amd"
  11325. | "amd-require"
  11326. | "umd"
  11327. | "umd2"
  11328. | "jsonp"
  11329. | "system"
  11330. | "promise"
  11331. | "script"
  11332. | "node-commonjs";
  11333. /**
  11334. * Ignore specific warnings.
  11335. */
  11336. ignoreWarnings?: ((
  11337. warning: WebpackError,
  11338. compilation: Compilation
  11339. ) => boolean)[];
  11340. /**
  11341. * Options for infrastructure level logging.
  11342. */
  11343. infrastructureLogging: InfrastructureLogging;
  11344. /**
  11345. * Custom values available in the loader context.
  11346. */
  11347. loader?: Loader;
  11348. /**
  11349. * Enable production optimizations or development hints.
  11350. */
  11351. mode?: "none" | "development" | "production";
  11352. /**
  11353. * Options affecting the normal modules (`NormalModuleFactory`).
  11354. */
  11355. module: ModuleOptionsNormalized;
  11356. /**
  11357. * Name of the configuration. Used when loading multiple configurations.
  11358. */
  11359. name?: string;
  11360. /**
  11361. * Include polyfills or mocks for various node stuff.
  11362. */
  11363. node: NodeWebpackOptions;
  11364. /**
  11365. * Enables/Disables integrated optimizations.
  11366. */
  11367. optimization: Optimization;
  11368. /**
  11369. * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  11370. */
  11371. output: OutputNormalized;
  11372. /**
  11373. * The number of parallel processed modules in the compilation.
  11374. */
  11375. parallelism?: number;
  11376. /**
  11377. * Configuration for web performance recommendations.
  11378. */
  11379. performance?: false | PerformanceOptions;
  11380. /**
  11381. * Add additional plugins to the compiler.
  11382. */
  11383. plugins: (
  11384. | ((this: Compiler, compiler: Compiler) => void)
  11385. | WebpackPluginInstance
  11386. )[];
  11387. /**
  11388. * Capture timing information for each module.
  11389. */
  11390. profile?: boolean;
  11391. /**
  11392. * Store compiler state to a json file.
  11393. */
  11394. recordsInputPath?: string | false;
  11395. /**
  11396. * Load compiler state from a json file.
  11397. */
  11398. recordsOutputPath?: string | false;
  11399. /**
  11400. * Options for the resolver.
  11401. */
  11402. resolve: ResolveOptionsWebpackOptions;
  11403. /**
  11404. * Options for the resolver when resolving loaders.
  11405. */
  11406. resolveLoader: ResolveOptionsWebpackOptions;
  11407. /**
  11408. * Options affecting how file system snapshots are created and validated.
  11409. */
  11410. snapshot: SnapshotOptions;
  11411. /**
  11412. * Stats options object or preset name.
  11413. */
  11414. stats: StatsValue;
  11415. /**
  11416. * Environment to build for. An array of environments to build for all of them when possible.
  11417. */
  11418. target?: string | false | string[];
  11419. /**
  11420. * Enter watch mode, which rebuilds on file change.
  11421. */
  11422. watch?: boolean;
  11423. /**
  11424. * Options for the watcher.
  11425. */
  11426. watchOptions: WatchOptions;
  11427. }
  11428. /**
  11429. * Plugin instance.
  11430. */
  11431. declare interface WebpackPluginInstance {
  11432. [index: string]: any;
  11433. /**
  11434. * The run point of the plugin, required method.
  11435. */
  11436. apply: (compiler: Compiler) => void;
  11437. }
  11438. declare interface WithId {
  11439. id: string | number;
  11440. }
  11441. declare interface WithOptions {
  11442. /**
  11443. * create a resolver with additional/different options
  11444. */
  11445. withOptions: (
  11446. arg0: Partial<ResolveOptionsWithDependencyType>
  11447. ) => ResolverWithOptions;
  11448. }
  11449. declare interface WriteOnlySet<T> {
  11450. add: (T?: any) => void;
  11451. }
  11452. type __TypeWebpackOptions = (data: object) =>
  11453. | string
  11454. | {
  11455. /**
  11456. * Unique loader options identifier.
  11457. */
  11458. ident?: string;
  11459. /**
  11460. * Loader name.
  11461. */
  11462. loader?: string;
  11463. /**
  11464. * Loader options.
  11465. */
  11466. options?: string | { [index: string]: any };
  11467. }
  11468. | __TypeWebpackOptions
  11469. | RuleSetUseItem[];
  11470. declare function exports(
  11471. options: Configuration,
  11472. callback?: CallbackWebpack<Stats>
  11473. ): Compiler;
  11474. declare function exports(
  11475. options: ReadonlyArray<Configuration> & MultiCompilerOptions,
  11476. callback?: CallbackWebpack<MultiStats>
  11477. ): MultiCompiler;
  11478. declare namespace exports {
  11479. export const webpack: {
  11480. (options: Configuration, callback?: CallbackWebpack<Stats>): Compiler;
  11481. (
  11482. options: ReadonlyArray<Configuration> & MultiCompilerOptions,
  11483. callback?: CallbackWebpack<MultiStats>
  11484. ): MultiCompiler;
  11485. };
  11486. export const validate: (options?: any) => void;
  11487. export const validateSchema: (
  11488. schema: Parameters<typeof validateFunction>[0],
  11489. options: Parameters<typeof validateFunction>[1],
  11490. validationConfiguration?: ValidationErrorConfiguration
  11491. ) => void;
  11492. export const version: string;
  11493. export namespace cli {
  11494. export let getArguments: (schema?: any) => Record<string, Argument>;
  11495. export let processArguments: (
  11496. args: Record<string, Argument>,
  11497. config: any,
  11498. values: Record<
  11499. string,
  11500. | string
  11501. | number
  11502. | boolean
  11503. | RegExp
  11504. | (string | number | boolean | RegExp)[]
  11505. >
  11506. ) => null | Problem[];
  11507. }
  11508. export namespace ModuleFilenameHelpers {
  11509. export let ALL_LOADERS_RESOURCE: string;
  11510. export let REGEXP_ALL_LOADERS_RESOURCE: RegExp;
  11511. export let LOADERS_RESOURCE: string;
  11512. export let REGEXP_LOADERS_RESOURCE: RegExp;
  11513. export let RESOURCE: string;
  11514. export let REGEXP_RESOURCE: RegExp;
  11515. export let ABSOLUTE_RESOURCE_PATH: string;
  11516. export let REGEXP_ABSOLUTE_RESOURCE_PATH: RegExp;
  11517. export let RESOURCE_PATH: string;
  11518. export let REGEXP_RESOURCE_PATH: RegExp;
  11519. export let ALL_LOADERS: string;
  11520. export let REGEXP_ALL_LOADERS: RegExp;
  11521. export let LOADERS: string;
  11522. export let REGEXP_LOADERS: RegExp;
  11523. export let QUERY: string;
  11524. export let REGEXP_QUERY: RegExp;
  11525. export let ID: string;
  11526. export let REGEXP_ID: RegExp;
  11527. export let HASH: string;
  11528. export let REGEXP_HASH: RegExp;
  11529. export let NAMESPACE: string;
  11530. export let REGEXP_NAMESPACE: RegExp;
  11531. export let createFilename: (
  11532. module: string | Module,
  11533. options: any,
  11534. __2: {
  11535. /**
  11536. * requestShortener
  11537. */
  11538. requestShortener: RequestShortener;
  11539. /**
  11540. * chunk graph
  11541. */
  11542. chunkGraph: ChunkGraph;
  11543. /**
  11544. * the hash function to use
  11545. */
  11546. hashFunction: string | typeof Hash;
  11547. }
  11548. ) => string;
  11549. export let replaceDuplicates: (
  11550. array?: any,
  11551. fn?: any,
  11552. comparator?: any
  11553. ) => any;
  11554. export let matchPart: (str?: any, test?: any) => any;
  11555. export let matchObject: (obj?: any, str?: any) => boolean;
  11556. }
  11557. export namespace RuntimeGlobals {
  11558. export let require: string;
  11559. export let requireScope: string;
  11560. export let exports: string;
  11561. export let thisAsExports: string;
  11562. export let returnExportsFromRuntime: string;
  11563. export let module: string;
  11564. export let moduleId: string;
  11565. export let moduleLoaded: string;
  11566. export let publicPath: string;
  11567. export let entryModuleId: string;
  11568. export let moduleCache: string;
  11569. export let moduleFactories: string;
  11570. export let moduleFactoriesAddOnly: string;
  11571. export let ensureChunk: string;
  11572. export let ensureChunkHandlers: string;
  11573. export let ensureChunkIncludeEntries: string;
  11574. export let prefetchChunk: string;
  11575. export let prefetchChunkHandlers: string;
  11576. export let preloadChunk: string;
  11577. export let preloadChunkHandlers: string;
  11578. export let definePropertyGetters: string;
  11579. export let makeNamespaceObject: string;
  11580. export let createFakeNamespaceObject: string;
  11581. export let compatGetDefaultExport: string;
  11582. export let harmonyModuleDecorator: string;
  11583. export let nodeModuleDecorator: string;
  11584. export let getFullHash: string;
  11585. export let wasmInstances: string;
  11586. export let instantiateWasm: string;
  11587. export let uncaughtErrorHandler: string;
  11588. export let scriptNonce: string;
  11589. export let loadScript: string;
  11590. export let createScript: string;
  11591. export let createScriptUrl: string;
  11592. export let getTrustedTypesPolicy: string;
  11593. export let chunkName: string;
  11594. export let runtimeId: string;
  11595. export let getChunkScriptFilename: string;
  11596. export let getChunkCssFilename: string;
  11597. export let hasCssModules: string;
  11598. export let getChunkUpdateScriptFilename: string;
  11599. export let getChunkUpdateCssFilename: string;
  11600. export let startup: string;
  11601. export let startupNoDefault: string;
  11602. export let startupOnlyAfter: string;
  11603. export let startupOnlyBefore: string;
  11604. export let chunkCallback: string;
  11605. export let startupEntrypoint: string;
  11606. export let onChunksLoaded: string;
  11607. export let externalInstallChunk: string;
  11608. export let interceptModuleExecution: string;
  11609. export let global: string;
  11610. export let shareScopeMap: string;
  11611. export let initializeSharing: string;
  11612. export let currentRemoteGetScope: string;
  11613. export let getUpdateManifestFilename: string;
  11614. export let hmrDownloadManifest: string;
  11615. export let hmrDownloadUpdateHandlers: string;
  11616. export let hmrModuleData: string;
  11617. export let hmrInvalidateModuleHandlers: string;
  11618. export let hmrRuntimeStatePrefix: string;
  11619. export let amdDefine: string;
  11620. export let amdOptions: string;
  11621. export let system: string;
  11622. export let hasOwnProperty: string;
  11623. export let systemContext: string;
  11624. export let baseURI: string;
  11625. export let relativeUrl: string;
  11626. export let asyncModule: string;
  11627. }
  11628. export const UsageState: Readonly<{
  11629. Unused: 0;
  11630. OnlyPropertiesUsed: 1;
  11631. NoInfo: 2;
  11632. Unknown: 3;
  11633. Used: 4;
  11634. }>;
  11635. export namespace cache {
  11636. export { MemoryCachePlugin };
  11637. }
  11638. export namespace config {
  11639. export const getNormalizedWebpackOptions: (
  11640. config: Configuration
  11641. ) => WebpackOptionsNormalized;
  11642. export const applyWebpackOptionsDefaults: (
  11643. options: WebpackOptionsNormalized
  11644. ) => void;
  11645. }
  11646. export namespace dependencies {
  11647. export { ModuleDependency, ConstDependency, NullDependency };
  11648. }
  11649. export namespace ids {
  11650. export {
  11651. ChunkModuleIdRangePlugin,
  11652. NaturalModuleIdsPlugin,
  11653. OccurrenceModuleIdsPlugin,
  11654. NamedModuleIdsPlugin,
  11655. DeterministicChunkIdsPlugin,
  11656. DeterministicModuleIdsPlugin,
  11657. NamedChunkIdsPlugin,
  11658. OccurrenceChunkIdsPlugin,
  11659. HashedModuleIdsPlugin
  11660. };
  11661. }
  11662. export namespace javascript {
  11663. export {
  11664. EnableChunkLoadingPlugin,
  11665. JavascriptModulesPlugin,
  11666. JavascriptParser
  11667. };
  11668. }
  11669. export namespace optimize {
  11670. export namespace InnerGraph {
  11671. export let bailout: (parserState: ParserState) => void;
  11672. export let enable: (parserState: ParserState) => void;
  11673. export let isEnabled: (parserState: ParserState) => boolean;
  11674. export let addUsage: (
  11675. state: ParserState,
  11676. symbol: null | TopLevelSymbol,
  11677. usage: string | true | TopLevelSymbol
  11678. ) => void;
  11679. export let addVariableUsage: (
  11680. parser: JavascriptParser,
  11681. name: string,
  11682. usage: string | true | TopLevelSymbol
  11683. ) => void;
  11684. export let inferDependencyUsage: (state: ParserState) => void;
  11685. export let onUsage: (
  11686. state: ParserState,
  11687. onUsageCallback: (arg0?: boolean | Set<string>) => void
  11688. ) => void;
  11689. export let setTopLevelSymbol: (
  11690. state: ParserState,
  11691. symbol: TopLevelSymbol
  11692. ) => void;
  11693. export let getTopLevelSymbol: (
  11694. state: ParserState
  11695. ) => void | TopLevelSymbol;
  11696. export let tagTopLevelSymbol: (
  11697. parser: JavascriptParser,
  11698. name: string
  11699. ) => TopLevelSymbol;
  11700. export let isDependencyUsedByExports: (
  11701. dependency: Dependency,
  11702. usedByExports: boolean | Set<string>,
  11703. moduleGraph: ModuleGraph,
  11704. runtime: RuntimeSpec
  11705. ) => boolean;
  11706. export let getDependencyUsedByExportsCondition: (
  11707. dependency: Dependency,
  11708. usedByExports: boolean | Set<string>,
  11709. moduleGraph: ModuleGraph
  11710. ) =>
  11711. | null
  11712. | false
  11713. | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState);
  11714. export { TopLevelSymbol, topLevelSymbolTag };
  11715. }
  11716. export {
  11717. AggressiveMergingPlugin,
  11718. AggressiveSplittingPlugin,
  11719. LimitChunkCountPlugin,
  11720. MinChunkSizePlugin,
  11721. ModuleConcatenationPlugin,
  11722. RealContentHashPlugin,
  11723. RuntimeChunkPlugin,
  11724. SideEffectsFlagPlugin,
  11725. SplitChunksPlugin
  11726. };
  11727. }
  11728. export namespace runtime {
  11729. export { GetChunkFilenameRuntimeModule, LoadScriptRuntimeModule };
  11730. }
  11731. export namespace prefetch {
  11732. export { ChunkPrefetchPreloadPlugin };
  11733. }
  11734. export namespace web {
  11735. export {
  11736. FetchCompileAsyncWasmPlugin,
  11737. FetchCompileWasmPlugin,
  11738. JsonpChunkLoadingRuntimeModule,
  11739. JsonpTemplatePlugin
  11740. };
  11741. }
  11742. export namespace webworker {
  11743. export { WebWorkerTemplatePlugin };
  11744. }
  11745. export namespace node {
  11746. export {
  11747. NodeEnvironmentPlugin,
  11748. NodeSourcePlugin,
  11749. NodeTargetPlugin,
  11750. NodeTemplatePlugin,
  11751. ReadFileCompileWasmPlugin
  11752. };
  11753. }
  11754. export namespace electron {
  11755. export { ElectronTargetPlugin };
  11756. }
  11757. export namespace wasm {
  11758. export { AsyncWebAssemblyModulesPlugin };
  11759. }
  11760. export namespace library {
  11761. export { AbstractLibraryPlugin, EnableLibraryPlugin };
  11762. }
  11763. export namespace container {
  11764. export const scope: <T>(
  11765. scope: string,
  11766. options: ContainerOptionsFormat<T>
  11767. ) => Record<string, string | string[] | T>;
  11768. export {
  11769. ContainerPlugin,
  11770. ContainerReferencePlugin,
  11771. ModuleFederationPlugin
  11772. };
  11773. }
  11774. export namespace sharing {
  11775. export const scope: <T>(
  11776. scope: string,
  11777. options: ContainerOptionsFormat<T>
  11778. ) => Record<string, string | string[] | T>;
  11779. export { ConsumeSharedPlugin, ProvideSharedPlugin, SharePlugin };
  11780. }
  11781. export namespace debug {
  11782. export { ProfilingPlugin };
  11783. }
  11784. export namespace util {
  11785. export const createHash: (algorithm: string | typeof Hash) => Hash;
  11786. export namespace comparators {
  11787. export let compareChunksById: (a: Chunk, b: Chunk) => 0 | 1 | -1;
  11788. export let compareModulesByIdentifier: (
  11789. a: Module,
  11790. b: Module
  11791. ) => 0 | 1 | -1;
  11792. export let compareModulesById: ParameterizedComparator<
  11793. ChunkGraph,
  11794. Module
  11795. >;
  11796. export let compareNumbers: (a: number, b: number) => 0 | 1 | -1;
  11797. export let compareStringsNumeric: (a: string, b: string) => 0 | 1 | -1;
  11798. export let compareModulesByPostOrderIndexOrIdentifier: ParameterizedComparator<
  11799. ModuleGraph,
  11800. Module
  11801. >;
  11802. export let compareModulesByPreOrderIndexOrIdentifier: ParameterizedComparator<
  11803. ModuleGraph,
  11804. Module
  11805. >;
  11806. export let compareModulesByIdOrIdentifier: ParameterizedComparator<
  11807. ChunkGraph,
  11808. Module
  11809. >;
  11810. export let compareChunks: ParameterizedComparator<ChunkGraph, Chunk>;
  11811. export let compareIds: (
  11812. a: string | number,
  11813. b: string | number
  11814. ) => 0 | 1 | -1;
  11815. export let compareStrings: (a: string, b: string) => 0 | 1 | -1;
  11816. export let compareChunkGroupsByIndex: (
  11817. a: ChunkGroup,
  11818. b: ChunkGroup
  11819. ) => 0 | 1 | -1;
  11820. export let concatComparators: <T>(
  11821. c1: Comparator<T>,
  11822. c2: Comparator<T>,
  11823. ...cRest: Comparator<T>[]
  11824. ) => Comparator<T>;
  11825. export let compareSelect: <T, R>(
  11826. getter: Selector<T, R>,
  11827. comparator: Comparator<R>
  11828. ) => Comparator<T>;
  11829. export let compareIterables: <T>(
  11830. elementComparator: Comparator<T>
  11831. ) => Comparator<Iterable<T>>;
  11832. export let keepOriginalOrder: <T>(iterable: Iterable<T>) => Comparator<T>;
  11833. export let compareChunksNatural: (
  11834. chunkGraph: ChunkGraph
  11835. ) => Comparator<Chunk>;
  11836. export let compareLocations: (
  11837. a: DependencyLocation,
  11838. b: DependencyLocation
  11839. ) => 0 | 1 | -1;
  11840. }
  11841. export namespace runtime {
  11842. export let getEntryRuntime: (
  11843. compilation: Compilation,
  11844. name: string,
  11845. options?: EntryOptions
  11846. ) => RuntimeSpec;
  11847. export let forEachRuntime: (
  11848. runtime: RuntimeSpec,
  11849. fn: (arg0: string) => void,
  11850. deterministicOrder?: boolean
  11851. ) => void;
  11852. export let getRuntimeKey: (runtime: RuntimeSpec) => string;
  11853. export let keyToRuntime: (key: string) => RuntimeSpec;
  11854. export let runtimeToString: (runtime: RuntimeSpec) => string;
  11855. export let runtimeConditionToString: (
  11856. runtimeCondition: RuntimeCondition
  11857. ) => string;
  11858. export let runtimeEqual: (a: RuntimeSpec, b: RuntimeSpec) => boolean;
  11859. export let compareRuntime: (a: RuntimeSpec, b: RuntimeSpec) => 0 | 1 | -1;
  11860. export let mergeRuntime: (a: RuntimeSpec, b: RuntimeSpec) => RuntimeSpec;
  11861. export let mergeRuntimeCondition: (
  11862. a: RuntimeCondition,
  11863. b: RuntimeCondition,
  11864. runtime: RuntimeSpec
  11865. ) => RuntimeCondition;
  11866. export let mergeRuntimeConditionNonFalse: (
  11867. a: undefined | string | true | SortableSet<string>,
  11868. b: undefined | string | true | SortableSet<string>,
  11869. runtime: RuntimeSpec
  11870. ) => undefined | string | true | SortableSet<string>;
  11871. export let mergeRuntimeOwned: (
  11872. a: RuntimeSpec,
  11873. b: RuntimeSpec
  11874. ) => RuntimeSpec;
  11875. export let intersectRuntime: (
  11876. a: RuntimeSpec,
  11877. b: RuntimeSpec
  11878. ) => RuntimeSpec;
  11879. export let subtractRuntime: (
  11880. a: RuntimeSpec,
  11881. b: RuntimeSpec
  11882. ) => RuntimeSpec;
  11883. export let subtractRuntimeCondition: (
  11884. a: RuntimeCondition,
  11885. b: RuntimeCondition,
  11886. runtime: RuntimeSpec
  11887. ) => RuntimeCondition;
  11888. export let filterRuntime: (
  11889. runtime: RuntimeSpec,
  11890. filter: (arg0: RuntimeSpec) => boolean
  11891. ) => undefined | string | boolean | SortableSet<string>;
  11892. export { RuntimeSpecMap, RuntimeSpecSet };
  11893. }
  11894. export namespace serialization {
  11895. export const register: (
  11896. Constructor: Constructor,
  11897. request: string,
  11898. name: string,
  11899. serializer: ObjectSerializer
  11900. ) => void;
  11901. export const registerLoader: (
  11902. regExp: RegExp,
  11903. loader: (arg0: string) => boolean
  11904. ) => void;
  11905. export const registerNotSerializable: (Constructor: Constructor) => void;
  11906. export const NOT_SERIALIZABLE: object;
  11907. export const buffersSerializer: Serializer;
  11908. export let createFileSerializer: (
  11909. fs?: any,
  11910. hashFunction?: any
  11911. ) => Serializer;
  11912. export { MEASURE_START_OPERATION, MEASURE_END_OPERATION };
  11913. }
  11914. export const cleverMerge: <T, O>(first: T, second: O) => T | O | (T & O);
  11915. export { LazySet };
  11916. }
  11917. export namespace sources {
  11918. export {
  11919. Source,
  11920. RawSource,
  11921. OriginalSource,
  11922. ReplaceSource,
  11923. SourceMapSource,
  11924. ConcatSource,
  11925. PrefixSource,
  11926. CachedSource,
  11927. SizeOnlySource,
  11928. CompatSource
  11929. };
  11930. }
  11931. export namespace experiments {
  11932. export namespace schemes {
  11933. export { HttpUriPlugin };
  11934. }
  11935. export namespace ids {
  11936. export { SyncModuleIdsPlugin };
  11937. }
  11938. }
  11939. export type WebpackPluginFunction = (
  11940. this: Compiler,
  11941. compiler: Compiler
  11942. ) => void;
  11943. export {
  11944. AutomaticPrefetchPlugin,
  11945. AsyncDependenciesBlock,
  11946. BannerPlugin,
  11947. Cache,
  11948. Chunk,
  11949. ChunkGraph,
  11950. CleanPlugin,
  11951. Compilation,
  11952. Compiler,
  11953. ConcatenationScope,
  11954. ContextExclusionPlugin,
  11955. ContextReplacementPlugin,
  11956. DefinePlugin,
  11957. DelegatedPlugin,
  11958. Dependency,
  11959. DllPlugin,
  11960. DllReferencePlugin,
  11961. DynamicEntryPlugin,
  11962. EntryOptionPlugin,
  11963. EntryPlugin,
  11964. EnvironmentPlugin,
  11965. EvalDevToolModulePlugin,
  11966. EvalSourceMapDevToolPlugin,
  11967. ExternalModule,
  11968. ExternalsPlugin,
  11969. Generator,
  11970. HotUpdateChunk,
  11971. HotModuleReplacementPlugin,
  11972. IgnorePlugin,
  11973. JavascriptModulesPlugin,
  11974. LibManifestPlugin,
  11975. LibraryTemplatePlugin,
  11976. LoaderOptionsPlugin,
  11977. LoaderTargetPlugin,
  11978. Module,
  11979. ModuleGraph,
  11980. ModuleGraphConnection,
  11981. NoEmitOnErrorsPlugin,
  11982. NormalModule,
  11983. NormalModuleReplacementPlugin,
  11984. MultiCompiler,
  11985. Parser,
  11986. PrefetchPlugin,
  11987. ProgressPlugin,
  11988. ProvidePlugin,
  11989. RuntimeModule,
  11990. EntryPlugin as SingleEntryPlugin,
  11991. SourceMapDevToolPlugin,
  11992. Stats,
  11993. Template,
  11994. WatchIgnorePlugin,
  11995. WebpackError,
  11996. WebpackOptionsApply,
  11997. WebpackOptionsDefaulter,
  11998. ValidationError as WebpackOptionsValidationError,
  11999. ValidationError,
  12000. Entry,
  12001. EntryNormalized,
  12002. EntryObject,
  12003. FileCacheOptions,
  12004. LibraryOptions,
  12005. ModuleOptions,
  12006. ResolveOptionsWebpackOptions as ResolveOptions,
  12007. RuleSetCondition,
  12008. RuleSetConditionAbsolute,
  12009. RuleSetRule,
  12010. RuleSetUse,
  12011. RuleSetUseItem,
  12012. StatsOptions,
  12013. Configuration,
  12014. WebpackOptionsNormalized,
  12015. WebpackPluginInstance,
  12016. Asset,
  12017. AssetInfo,
  12018. EntryOptions,
  12019. AssetEmittedInfo,
  12020. MultiStats,
  12021. ParserState,
  12022. ResolvePluginInstance,
  12023. Resolver,
  12024. Watching,
  12025. Argument,
  12026. Problem,
  12027. StatsAsset,
  12028. StatsChunk,
  12029. StatsChunkGroup,
  12030. StatsChunkOrigin,
  12031. StatsCompilation,
  12032. StatsError,
  12033. StatsLogging,
  12034. StatsLoggingEntry,
  12035. StatsModule,
  12036. StatsModuleIssuer,
  12037. StatsModuleReason,
  12038. StatsModuleTraceDependency,
  12039. StatsModuleTraceItem,
  12040. StatsProfile,
  12041. LoaderModule,
  12042. RawLoaderDefinition,
  12043. LoaderDefinition,
  12044. LoaderDefinitionFunction,
  12045. PitchLoaderDefinitionFunction,
  12046. RawLoaderDefinitionFunction,
  12047. LoaderContext
  12048. };
  12049. }
  12050. declare const topLevelSymbolTag: unique symbol;
  12051. export = exports;