types.d.ts 299 KB

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