@rsbuild/core 0.6.8 → 0.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/compiled/commander/{typings/index.d.ts → index.d.ts} +26 -24
  2. package/compiled/commander/index.js +3528 -1
  3. package/compiled/commander/package.json +1 -1
  4. package/compiled/connect-history-api-fallback/index.js +186 -1
  5. package/compiled/dotenv/{lib/main.d.ts → index.d.ts} +16 -12
  6. package/compiled/dotenv/index.js +458 -1
  7. package/compiled/dotenv/package.json +1 -1
  8. package/compiled/dotenv-expand/{lib/main.d.ts → index.d.ts} +9 -7
  9. package/compiled/dotenv-expand/index.js +146 -1
  10. package/compiled/dotenv-expand/package.json +1 -1
  11. package/compiled/http-compression/index.js +185 -1
  12. package/compiled/launch-editor-middleware/index.js +843 -1
  13. package/compiled/on-finished/index.d.ts +2 -2
  14. package/compiled/on-finished/index.js +390 -3
  15. package/compiled/on-finished/package.json +1 -1
  16. package/compiled/open/index.d.ts +1 -153
  17. package/compiled/open/index.js +526 -1
  18. package/compiled/open/package.json +1 -1
  19. package/compiled/sirv/index.d.ts +1 -0
  20. package/compiled/sirv/index.js +798 -1
  21. package/compiled/sirv/package.json +1 -1
  22. package/compiled/webpack-dev-middleware/index.d.ts +1 -0
  23. package/compiled/webpack-dev-middleware/index.js +6696 -0
  24. package/compiled/webpack-dev-middleware/license +20 -0
  25. package/compiled/webpack-dev-middleware/package.json +1 -0
  26. package/compiled/webpack-dev-middleware/schema-utils.js +1 -0
  27. package/compiled/ws/index.d.ts +7 -15
  28. package/compiled/ws/index.js +4885 -1
  29. package/compiled/ws/package.json +1 -1
  30. package/dist/cli/commands.js +1 -1
  31. package/dist/cli/prepare.js +1 -1
  32. package/dist/client/format.d.ts +5 -0
  33. package/dist/client/{formatStats.js → format.js} +8 -43
  34. package/dist/client/{hmr/index.d.ts → hmr.d.ts} +4 -0
  35. package/dist/client/hmr.mjs +194 -431
  36. package/dist/client/overlay.mjs +205 -227
  37. package/dist/createContext.js +1 -1
  38. package/dist/index.js +1 -1
  39. package/dist/plugins/target.js +19 -16
  40. package/dist/provider/plugins/swc.js +1 -0
  41. package/dist/provider/shared.js +2 -2
  42. package/dist/server/devMiddleware.js +1 -1
  43. package/dist/server/devServer.js +6 -1
  44. package/dist/server/getDevMiddlewares.d.ts +3 -0
  45. package/dist/server/getDevMiddlewares.js +6 -8
  46. package/dist/server/helper.d.ts +4 -4
  47. package/dist/server/middlewares.d.ts +5 -2
  48. package/dist/server/middlewares.js +1 -7
  49. package/package.json +6 -5
  50. package/compiled/open/license +0 -9
  51. package/compiled/sirv/sirv.d.ts +0 -27
  52. package/dist/client/formatStats.d.ts +0 -12
  53. package/dist/client/hmr/url.d.ts +0 -6
@@ -1 +1,798 @@
1
- (()=>{var i={665:(i,a,t)=>{const p=t(477);function parse(i){let a=i.url;if(a==null)return;let t=i._parsedUrl;if(t&&t.raw===a)return t;let e=a,l="",o;if(a.length>1){let i=a.indexOf("?",1);if(i!==-1){l=a.substring(i);e=a.substring(0,i);if(l.length>1){o=p.parse(l.substring(1))}}}return i._parsedUrl={pathname:e,search:l,query:o,raw:a}}a.parse=parse},786:(i,a)=>{const t={"3g2":"video/3gpp2","3gp":"video/3gpp","3gpp":"video/3gpp","3mf":"model/3mf",aac:"audio/aac",ac:"application/pkix-attr-cert",adp:"audio/adpcm",adts:"audio/aac",ai:"application/postscript",aml:"application/automationml-aml+xml",amlx:"application/automationml-amlx+zip",amr:"audio/amr",apng:"image/apng",appcache:"text/cache-manifest",appinstaller:"application/appinstaller",appx:"application/appx",appxbundle:"application/appxbundle",asc:"application/pgp-keys",atom:"application/atom+xml",atomcat:"application/atomcat+xml",atomdeleted:"application/atomdeleted+xml",atomsvc:"application/atomsvc+xml",au:"audio/basic",avci:"image/avci",avcs:"image/avcs",avif:"image/avif",aw:"application/applixware",bdoc:"application/bdoc",bin:"application/octet-stream",bmp:"image/bmp",bpk:"application/octet-stream",btf:"image/prs.btif",btif:"image/prs.btif",buffer:"application/octet-stream",ccxml:"application/ccxml+xml",cdfx:"application/cdfx+xml",cdmia:"application/cdmi-capability",cdmic:"application/cdmi-container",cdmid:"application/cdmi-domain",cdmio:"application/cdmi-object",cdmiq:"application/cdmi-queue",cer:"application/pkix-cert",cgm:"image/cgm",cjs:"application/node",class:"application/java-vm",coffee:"text/coffeescript",conf:"text/plain",cpl:"application/cpl+xml",cpt:"application/mac-compactpro",crl:"application/pkix-crl",css:"text/css",csv:"text/csv",cu:"application/cu-seeme",cwl:"application/cwl",cww:"application/prs.cww",davmount:"application/davmount+xml",dbk:"application/docbook+xml",deb:"application/octet-stream",def:"text/plain",deploy:"application/octet-stream",dib:"image/bmp","disposition-notification":"message/disposition-notification",dist:"application/octet-stream",distz:"application/octet-stream",dll:"application/octet-stream",dmg:"application/octet-stream",dms:"application/octet-stream",doc:"application/msword",dot:"application/msword",dpx:"image/dpx",drle:"image/dicom-rle",dsc:"text/prs.lines.tag",dssc:"application/dssc+der",dtd:"application/xml-dtd",dump:"application/octet-stream",dwd:"application/atsc-dwd+xml",ear:"application/java-archive",ecma:"application/ecmascript",elc:"application/octet-stream",emf:"image/emf",eml:"message/rfc822",emma:"application/emma+xml",emotionml:"application/emotionml+xml",eps:"application/postscript",epub:"application/epub+zip",exe:"application/octet-stream",exi:"application/exi",exp:"application/express",exr:"image/aces",ez:"application/andrew-inset",fdf:"application/fdf",fdt:"application/fdt+xml",fits:"image/fits",g3:"image/g3fax",gbr:"application/rpki-ghostbusters",geojson:"application/geo+json",gif:"image/gif",glb:"model/gltf-binary",gltf:"model/gltf+json",gml:"application/gml+xml",gpx:"application/gpx+xml",gram:"application/srgs",grxml:"application/srgs+xml",gxf:"application/gxf",gz:"application/gzip",h261:"video/h261",h263:"video/h263",h264:"video/h264",heic:"image/heic",heics:"image/heic-sequence",heif:"image/heif",heifs:"image/heif-sequence",hej2:"image/hej2k",held:"application/atsc-held+xml",hjson:"application/hjson",hlp:"application/winhlp",hqx:"application/mac-binhex40",hsj2:"image/hsj2",htm:"text/html",html:"text/html",ics:"text/calendar",ief:"image/ief",ifb:"text/calendar",iges:"model/iges",igs:"model/iges",img:"application/octet-stream",in:"text/plain",ini:"text/plain",ink:"application/inkml+xml",inkml:"application/inkml+xml",ipfix:"application/ipfix",iso:"application/octet-stream",its:"application/its+xml",jade:"text/jade",jar:"application/java-archive",jhc:"image/jphc",jls:"image/jls",jp2:"image/jp2",jpe:"image/jpeg",jpeg:"image/jpeg",jpf:"image/jpx",jpg:"image/jpeg",jpg2:"image/jp2",jpgm:"image/jpm",jpgv:"video/jpeg",jph:"image/jph",jpm:"image/jpm",jpx:"image/jpx",js:"text/javascript",json:"application/json",json5:"application/json5",jsonld:"application/ld+json",jsonml:"application/jsonml+json",jsx:"text/jsx",jt:"model/jt",jxr:"image/jxr",jxra:"image/jxra",jxrs:"image/jxrs",jxs:"image/jxs",jxsc:"image/jxsc",jxsi:"image/jxsi",jxss:"image/jxss",kar:"audio/midi",ktx:"image/ktx",ktx2:"image/ktx2",less:"text/less",lgr:"application/lgr+xml",list:"text/plain",litcoffee:"text/coffeescript",log:"text/plain",lostxml:"application/lost+xml",lrf:"application/octet-stream",m1v:"video/mpeg",m21:"application/mp21",m2a:"audio/mpeg",m2v:"video/mpeg",m3a:"audio/mpeg",m4a:"audio/mp4",m4p:"application/mp4",m4s:"video/iso.segment",ma:"application/mathematica",mads:"application/mads+xml",maei:"application/mmt-aei+xml",man:"text/troff",manifest:"text/cache-manifest",map:"application/json",mar:"application/octet-stream",markdown:"text/markdown",mathml:"application/mathml+xml",mb:"application/mathematica",mbox:"application/mbox",md:"text/markdown",mdx:"text/mdx",me:"text/troff",mesh:"model/mesh",meta4:"application/metalink4+xml",metalink:"application/metalink+xml",mets:"application/mets+xml",mft:"application/rpki-manifest",mid:"audio/midi",midi:"audio/midi",mime:"message/rfc822",mj2:"video/mj2",mjp2:"video/mj2",mjs:"text/javascript",mml:"text/mathml",mods:"application/mods+xml",mov:"video/quicktime",mp2:"audio/mpeg",mp21:"application/mp21",mp2a:"audio/mpeg",mp3:"audio/mpeg",mp4:"video/mp4",mp4a:"audio/mp4",mp4s:"application/mp4",mp4v:"video/mp4",mpd:"application/dash+xml",mpe:"video/mpeg",mpeg:"video/mpeg",mpf:"application/media-policy-dataset+xml",mpg:"video/mpeg",mpg4:"video/mp4",mpga:"audio/mpeg",mpp:"application/dash-patch+xml",mrc:"application/marc",mrcx:"application/marcxml+xml",ms:"text/troff",mscml:"application/mediaservercontrol+xml",msh:"model/mesh",msi:"application/octet-stream",msix:"application/msix",msixbundle:"application/msixbundle",msm:"application/octet-stream",msp:"application/octet-stream",mtl:"model/mtl",musd:"application/mmt-usd+xml",mxf:"application/mxf",mxmf:"audio/mobile-xmf",mxml:"application/xv+xml",n3:"text/n3",nb:"application/mathematica",nq:"application/n-quads",nt:"application/n-triples",obj:"model/obj",oda:"application/oda",oga:"audio/ogg",ogg:"audio/ogg",ogv:"video/ogg",ogx:"application/ogg",omdoc:"application/omdoc+xml",onepkg:"application/onenote",onetmp:"application/onenote",onetoc:"application/onenote",onetoc2:"application/onenote",opf:"application/oebps-package+xml",opus:"audio/ogg",otf:"font/otf",owl:"application/rdf+xml",oxps:"application/oxps",p10:"application/pkcs10",p7c:"application/pkcs7-mime",p7m:"application/pkcs7-mime",p7s:"application/pkcs7-signature",p8:"application/pkcs8",pdf:"application/pdf",pfr:"application/font-tdpfr",pgp:"application/pgp-encrypted",pkg:"application/octet-stream",pki:"application/pkixcmp",pkipath:"application/pkix-pkipath",pls:"application/pls+xml",png:"image/png",prc:"model/prc",prf:"application/pics-rules",provx:"application/provenance+xml",ps:"application/postscript",pskcxml:"application/pskc+xml",pti:"image/prs.pti",qt:"video/quicktime",raml:"application/raml+yaml",rapd:"application/route-apd+xml",rdf:"application/rdf+xml",relo:"application/p2p-overlay+xml",rif:"application/reginfo+xml",rl:"application/resource-lists+xml",rld:"application/resource-lists-diff+xml",rmi:"audio/midi",rnc:"application/relax-ng-compact-syntax",rng:"application/xml",roa:"application/rpki-roa",roff:"text/troff",rq:"application/sparql-query",rs:"application/rls-services+xml",rsat:"application/atsc-rsat+xml",rsd:"application/rsd+xml",rsheet:"application/urc-ressheet+xml",rss:"application/rss+xml",rtf:"text/rtf",rtx:"text/richtext",rusd:"application/route-usd+xml",s3m:"audio/s3m",sbml:"application/sbml+xml",scq:"application/scvp-cv-request",scs:"application/scvp-cv-response",sdp:"application/sdp",senmlx:"application/senml+xml",sensmlx:"application/sensml+xml",ser:"application/java-serialized-object",setpay:"application/set-payment-initiation",setreg:"application/set-registration-initiation",sgi:"image/sgi",sgm:"text/sgml",sgml:"text/sgml",shex:"text/shex",shf:"application/shf+xml",shtml:"text/html",sieve:"application/sieve",sig:"application/pgp-signature",sil:"audio/silk",silo:"model/mesh",siv:"application/sieve",slim:"text/slim",slm:"text/slim",sls:"application/route-s-tsid+xml",smi:"application/smil+xml",smil:"application/smil+xml",snd:"audio/basic",so:"application/octet-stream",spdx:"text/spdx",spp:"application/scvp-vp-response",spq:"application/scvp-vp-request",spx:"audio/ogg",sql:"application/sql",sru:"application/sru+xml",srx:"application/sparql-results+xml",ssdl:"application/ssdl+xml",ssml:"application/ssml+xml",stk:"application/hyperstudio",stl:"model/stl",stpx:"model/step+xml",stpxz:"model/step-xml+zip",stpz:"model/step+zip",styl:"text/stylus",stylus:"text/stylus",svg:"image/svg+xml",svgz:"image/svg+xml",swidtag:"application/swid+xml",t:"text/troff",t38:"image/t38",td:"application/urc-targetdesc+xml",tei:"application/tei+xml",teicorpus:"application/tei+xml",text:"text/plain",tfi:"application/thraud+xml",tfx:"image/tiff-fx",tif:"image/tiff",tiff:"image/tiff",toml:"application/toml",tr:"text/troff",trig:"application/trig",ts:"video/mp2t",tsd:"application/timestamped-data",tsv:"text/tab-separated-values",ttc:"font/collection",ttf:"font/ttf",ttl:"text/turtle",ttml:"application/ttml+xml",txt:"text/plain",u3d:"model/u3d",u8dsn:"message/global-delivery-status",u8hdr:"message/global-headers",u8mdn:"message/global-disposition-notification",u8msg:"message/global",ubj:"application/ubjson",uri:"text/uri-list",uris:"text/uri-list",urls:"text/uri-list",vcard:"text/vcard",vrml:"model/vrml",vtt:"text/vtt",vxml:"application/voicexml+xml",war:"application/java-archive",wasm:"application/wasm",wav:"audio/wav",weba:"audio/webm",webm:"video/webm",webmanifest:"application/manifest+json",webp:"image/webp",wgsl:"text/wgsl",wgt:"application/widget",wif:"application/watcherinfo+xml",wmf:"image/wmf",woff:"font/woff",woff2:"font/woff2",wrl:"model/vrml",wsdl:"application/wsdl+xml",wspolicy:"application/wspolicy+xml",x3d:"model/x3d+xml",x3db:"model/x3d+fastinfoset",x3dbz:"model/x3d+binary",x3dv:"model/x3d-vrml",x3dvz:"model/x3d+vrml",x3dz:"model/x3d+xml",xaml:"application/xaml+xml",xav:"application/xcap-att+xml",xca:"application/xcap-caps+xml",xcs:"application/calendar+xml",xdf:"application/xcap-diff+xml",xdssc:"application/dssc+xml",xel:"application/xcap-el+xml",xenc:"application/xenc+xml",xer:"application/patch-ops-error+xml",xfdf:"application/xfdf",xht:"application/xhtml+xml",xhtml:"application/xhtml+xml",xhvml:"application/xv+xml",xlf:"application/xliff+xml",xm:"audio/xm",xml:"text/xml",xns:"application/xcap-ns+xml",xop:"application/xop+xml",xpl:"application/xproc+xml",xsd:"application/xml",xsf:"application/prs.xsf+xml",xsl:"application/xml",xslt:"application/xml",xspf:"application/xspf+xml",xvm:"application/xv+xml",xvml:"application/xv+xml",yaml:"text/yaml",yang:"application/yang",yin:"application/yin+xml",yml:"text/yaml",zip:"application/zip"};function lookup(i){let a=(""+i).trim().toLowerCase();let p=a.lastIndexOf(".");return t[!~p?a:a.substring(++p)]}a.mimes=t;a.lookup=lookup},486:(i,a,t)=>{const p=t(147);const{join:e,normalize:l,resolve:o}=t(17);const{totalist:s}=t(190);const{parse:m}=t(665);const{lookup:n}=t(786);const noop=()=>{};function isMatch(i,a){for(let t=0;t<a.length;t++){if(a[t].test(i))return true}}function toAssume(i,a){let t=0,p,e=i.length-1;if(i.charCodeAt(e)===47){i=i.substring(0,e)}let l=[],o=`${i}/index`;for(;t<a.length;t++){p=a[t]?`.${a[t]}`:"";if(i)l.push(i+p);l.push(o+p)}return l}function viaCache(i,a,t){let p=0,e,l=toAssume(a,t);for(;p<l.length;p++){if(e=i[l[p]])return e}}function viaLocal(i,a,t,o){let s=0,m=toAssume(t,o);let n,c,r,x;for(;s<m.length;s++){n=l(e(i,r=m[s]));if(n.startsWith(i)&&p.existsSync(n)){c=p.statSync(n);if(c.isDirectory())continue;x=toHeaders(r,c,a);x["Cache-Control"]=a?"no-cache":"no-store";return{abs:n,stats:c,headers:x}}}}function is404(i,a){return a.statusCode=404,a.end()}function send(i,a,t,e,l){let o=200,s,m={};l={...l};for(let i in l){s=a.getHeader(i);if(s)l[i]=s}if(s=a.getHeader("content-type")){l["Content-Type"]=s}if(i.headers.range){o=206;let[t,p]=i.headers.range.replace("bytes=","").split("-");let s=m.end=parseInt(p,10)||e.size-1;let n=m.start=parseInt(t,10)||0;if(s>=e.size){s=e.size-1}if(n>=e.size){a.setHeader("Content-Range",`bytes */${e.size}`);a.statusCode=416;return a.end()}l["Content-Range"]=`bytes ${n}-${s}/${e.size}`;l["Content-Length"]=s-n+1;l["Accept-Ranges"]="bytes"}a.writeHead(o,l);p.createReadStream(t,m).pipe(a)}const c={".br":"br",".gz":"gzip"};function toHeaders(i,a,t){let p=c[i.slice(-3)];let e=n(i.slice(0,p&&-3))||"";if(e==="text/html")e+=";charset=utf-8";let l={"Content-Length":a.size,"Content-Type":e,"Last-Modified":a.mtime.toUTCString()};if(p)l["Content-Encoding"]=p;if(t)l["ETag"]=`W/"${a.size}-${a.mtime.getTime()}"`;return l}i.exports=function(i,a={}){i=o(i||".");let t=a.onNoMatch||is404;let p=a.setHeaders||noop;let e=a.extensions||["html","htm"];let l=a.gzip&&e.map((i=>`${i}.gz`)).concat("gz");let n=a.brotli&&e.map((i=>`${i}.br`)).concat("br");const c={};let r="/";let x=!!a.etag;let d=!!a.single;if(typeof a.single==="string"){let i=a.single.lastIndexOf(".");r+=!!~i?a.single.substring(0,i):a.single}let g=[];if(a.ignores!==false){g.push(/[/]([A-Za-z\s\d~$._-]+\.\w+){1,}$/);if(a.dotfiles)g.push(/\/\.\w/);else g.push(/\/\.well-known/);[].concat(a.ignores||[]).forEach((i=>{g.push(new RegExp(i,"i"))}))}let f=a.maxAge!=null&&`public,max-age=${a.maxAge}`;if(f&&a.immutable)f+=",immutable";else if(f&&a.maxAge===0)f+=",must-revalidate";if(!a.dev){s(i,((i,t,p)=>{if(/\.well-known[\\+\/]/.test(i)){}else if(!a.dotfiles&&/(^\.|[\\+|\/+]\.)/.test(i))return;let e=toHeaders(i,p,x);if(f)e["Cache-Control"]=f;c["/"+i.normalize().replace(/\\+/g,"/")]={abs:t,stats:p,headers:e}}))}let u=a.dev?viaLocal.bind(0,i,x):viaCache.bind(0,c);return function(i,a,o){let s=[""];let c=m(i).pathname;let f=i.headers["accept-encoding"]||"";if(l&&f.includes("gzip"))s.unshift(...l);if(n&&/(br|brotli)/i.test(f))s.unshift(...n);s.push(...e);if(c.indexOf("%")!==-1){try{c=decodeURI(c)}catch(i){}}let h=u(c,s)||d&&!isMatch(c,g)&&u(r,s);if(!h)return o?o():t(i,a);if(x&&i.headers["if-none-match"]===h.headers["ETag"]){a.writeHead(304);return a.end()}if(l||n){a.setHeader("Vary","Accept-Encoding")}p(a,c,h.stats);send(i,a,h.abs,h.stats,h.headers)}}},190:(i,a,t)=>{const{join:p,resolve:e}=t(17);const{readdirSync:l,statSync:o}=t(147);function totalist(i,a,t=""){i=e(".",i);let s=l(i);let m=0,n,c;for(;m<s.length;m++){n=p(i,s[m]);c=o(n);c.isDirectory()?totalist(n,a,p(t,s[m])):a(p(t,s[m]),n,c)}}a.totalist=totalist},147:i=>{"use strict";i.exports=require("fs")},17:i=>{"use strict";i.exports=require("path")},477:i=>{"use strict";i.exports=require("querystring")}};var a={};function __nccwpck_require__(t){var p=a[t];if(p!==undefined){return p.exports}var e=a[t]={exports:{}};var l=true;try{i[t](e,e.exports,__nccwpck_require__);l=false}finally{if(l)delete a[t]}return e.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var t=__nccwpck_require__(486);module.exports=t})();
1
+ /******/ (() => { // webpackBootstrap
2
+ /******/ var __webpack_modules__ = ({
3
+
4
+ /***/ 665:
5
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
6
+
7
+ const qs = __nccwpck_require__(477);
8
+
9
+ /**
10
+ * @typedef ParsedURL
11
+ * @type {import('.').ParsedURL}
12
+ */
13
+
14
+ /**
15
+ * @typedef Request
16
+ * @property {string} url
17
+ * @property {ParsedURL} _parsedUrl
18
+ */
19
+
20
+ /**
21
+ * @param {Request} req
22
+ * @returns {ParsedURL|void}
23
+ */
24
+ function parse(req) {
25
+ let raw = req.url;
26
+ if (raw == null) return;
27
+
28
+ let prev = req._parsedUrl;
29
+ if (prev && prev.raw === raw) return prev;
30
+
31
+ let pathname=raw, search='', query;
32
+
33
+ if (raw.length > 1) {
34
+ let idx = raw.indexOf('?', 1);
35
+
36
+ if (idx !== -1) {
37
+ search = raw.substring(idx);
38
+ pathname = raw.substring(0, idx);
39
+ if (search.length > 1) {
40
+ query = qs.parse(search.substring(1));
41
+ }
42
+ }
43
+ }
44
+
45
+ return req._parsedUrl = { pathname, search, query, raw };
46
+ }
47
+
48
+ exports.parse = parse;
49
+
50
+ /***/ }),
51
+
52
+ /***/ 786:
53
+ /***/ ((__unused_webpack_module, exports) => {
54
+
55
+ const mimes = {
56
+ "3g2": "video/3gpp2",
57
+ "3gp": "video/3gpp",
58
+ "3gpp": "video/3gpp",
59
+ "3mf": "model/3mf",
60
+ "aac": "audio/aac",
61
+ "ac": "application/pkix-attr-cert",
62
+ "adp": "audio/adpcm",
63
+ "adts": "audio/aac",
64
+ "ai": "application/postscript",
65
+ "aml": "application/automationml-aml+xml",
66
+ "amlx": "application/automationml-amlx+zip",
67
+ "amr": "audio/amr",
68
+ "apng": "image/apng",
69
+ "appcache": "text/cache-manifest",
70
+ "appinstaller": "application/appinstaller",
71
+ "appx": "application/appx",
72
+ "appxbundle": "application/appxbundle",
73
+ "asc": "application/pgp-keys",
74
+ "atom": "application/atom+xml",
75
+ "atomcat": "application/atomcat+xml",
76
+ "atomdeleted": "application/atomdeleted+xml",
77
+ "atomsvc": "application/atomsvc+xml",
78
+ "au": "audio/basic",
79
+ "avci": "image/avci",
80
+ "avcs": "image/avcs",
81
+ "avif": "image/avif",
82
+ "aw": "application/applixware",
83
+ "bdoc": "application/bdoc",
84
+ "bin": "application/octet-stream",
85
+ "bmp": "image/bmp",
86
+ "bpk": "application/octet-stream",
87
+ "btf": "image/prs.btif",
88
+ "btif": "image/prs.btif",
89
+ "buffer": "application/octet-stream",
90
+ "ccxml": "application/ccxml+xml",
91
+ "cdfx": "application/cdfx+xml",
92
+ "cdmia": "application/cdmi-capability",
93
+ "cdmic": "application/cdmi-container",
94
+ "cdmid": "application/cdmi-domain",
95
+ "cdmio": "application/cdmi-object",
96
+ "cdmiq": "application/cdmi-queue",
97
+ "cer": "application/pkix-cert",
98
+ "cgm": "image/cgm",
99
+ "cjs": "application/node",
100
+ "class": "application/java-vm",
101
+ "coffee": "text/coffeescript",
102
+ "conf": "text/plain",
103
+ "cpl": "application/cpl+xml",
104
+ "cpt": "application/mac-compactpro",
105
+ "crl": "application/pkix-crl",
106
+ "css": "text/css",
107
+ "csv": "text/csv",
108
+ "cu": "application/cu-seeme",
109
+ "cwl": "application/cwl",
110
+ "cww": "application/prs.cww",
111
+ "davmount": "application/davmount+xml",
112
+ "dbk": "application/docbook+xml",
113
+ "deb": "application/octet-stream",
114
+ "def": "text/plain",
115
+ "deploy": "application/octet-stream",
116
+ "dib": "image/bmp",
117
+ "disposition-notification": "message/disposition-notification",
118
+ "dist": "application/octet-stream",
119
+ "distz": "application/octet-stream",
120
+ "dll": "application/octet-stream",
121
+ "dmg": "application/octet-stream",
122
+ "dms": "application/octet-stream",
123
+ "doc": "application/msword",
124
+ "dot": "application/msword",
125
+ "dpx": "image/dpx",
126
+ "drle": "image/dicom-rle",
127
+ "dsc": "text/prs.lines.tag",
128
+ "dssc": "application/dssc+der",
129
+ "dtd": "application/xml-dtd",
130
+ "dump": "application/octet-stream",
131
+ "dwd": "application/atsc-dwd+xml",
132
+ "ear": "application/java-archive",
133
+ "ecma": "application/ecmascript",
134
+ "elc": "application/octet-stream",
135
+ "emf": "image/emf",
136
+ "eml": "message/rfc822",
137
+ "emma": "application/emma+xml",
138
+ "emotionml": "application/emotionml+xml",
139
+ "eps": "application/postscript",
140
+ "epub": "application/epub+zip",
141
+ "exe": "application/octet-stream",
142
+ "exi": "application/exi",
143
+ "exp": "application/express",
144
+ "exr": "image/aces",
145
+ "ez": "application/andrew-inset",
146
+ "fdf": "application/fdf",
147
+ "fdt": "application/fdt+xml",
148
+ "fits": "image/fits",
149
+ "g3": "image/g3fax",
150
+ "gbr": "application/rpki-ghostbusters",
151
+ "geojson": "application/geo+json",
152
+ "gif": "image/gif",
153
+ "glb": "model/gltf-binary",
154
+ "gltf": "model/gltf+json",
155
+ "gml": "application/gml+xml",
156
+ "gpx": "application/gpx+xml",
157
+ "gram": "application/srgs",
158
+ "grxml": "application/srgs+xml",
159
+ "gxf": "application/gxf",
160
+ "gz": "application/gzip",
161
+ "h261": "video/h261",
162
+ "h263": "video/h263",
163
+ "h264": "video/h264",
164
+ "heic": "image/heic",
165
+ "heics": "image/heic-sequence",
166
+ "heif": "image/heif",
167
+ "heifs": "image/heif-sequence",
168
+ "hej2": "image/hej2k",
169
+ "held": "application/atsc-held+xml",
170
+ "hjson": "application/hjson",
171
+ "hlp": "application/winhlp",
172
+ "hqx": "application/mac-binhex40",
173
+ "hsj2": "image/hsj2",
174
+ "htm": "text/html",
175
+ "html": "text/html",
176
+ "ics": "text/calendar",
177
+ "ief": "image/ief",
178
+ "ifb": "text/calendar",
179
+ "iges": "model/iges",
180
+ "igs": "model/iges",
181
+ "img": "application/octet-stream",
182
+ "in": "text/plain",
183
+ "ini": "text/plain",
184
+ "ink": "application/inkml+xml",
185
+ "inkml": "application/inkml+xml",
186
+ "ipfix": "application/ipfix",
187
+ "iso": "application/octet-stream",
188
+ "its": "application/its+xml",
189
+ "jade": "text/jade",
190
+ "jar": "application/java-archive",
191
+ "jhc": "image/jphc",
192
+ "jls": "image/jls",
193
+ "jp2": "image/jp2",
194
+ "jpe": "image/jpeg",
195
+ "jpeg": "image/jpeg",
196
+ "jpf": "image/jpx",
197
+ "jpg": "image/jpeg",
198
+ "jpg2": "image/jp2",
199
+ "jpgm": "image/jpm",
200
+ "jpgv": "video/jpeg",
201
+ "jph": "image/jph",
202
+ "jpm": "image/jpm",
203
+ "jpx": "image/jpx",
204
+ "js": "text/javascript",
205
+ "json": "application/json",
206
+ "json5": "application/json5",
207
+ "jsonld": "application/ld+json",
208
+ "jsonml": "application/jsonml+json",
209
+ "jsx": "text/jsx",
210
+ "jt": "model/jt",
211
+ "jxr": "image/jxr",
212
+ "jxra": "image/jxra",
213
+ "jxrs": "image/jxrs",
214
+ "jxs": "image/jxs",
215
+ "jxsc": "image/jxsc",
216
+ "jxsi": "image/jxsi",
217
+ "jxss": "image/jxss",
218
+ "kar": "audio/midi",
219
+ "ktx": "image/ktx",
220
+ "ktx2": "image/ktx2",
221
+ "less": "text/less",
222
+ "lgr": "application/lgr+xml",
223
+ "list": "text/plain",
224
+ "litcoffee": "text/coffeescript",
225
+ "log": "text/plain",
226
+ "lostxml": "application/lost+xml",
227
+ "lrf": "application/octet-stream",
228
+ "m1v": "video/mpeg",
229
+ "m21": "application/mp21",
230
+ "m2a": "audio/mpeg",
231
+ "m2v": "video/mpeg",
232
+ "m3a": "audio/mpeg",
233
+ "m4a": "audio/mp4",
234
+ "m4p": "application/mp4",
235
+ "m4s": "video/iso.segment",
236
+ "ma": "application/mathematica",
237
+ "mads": "application/mads+xml",
238
+ "maei": "application/mmt-aei+xml",
239
+ "man": "text/troff",
240
+ "manifest": "text/cache-manifest",
241
+ "map": "application/json",
242
+ "mar": "application/octet-stream",
243
+ "markdown": "text/markdown",
244
+ "mathml": "application/mathml+xml",
245
+ "mb": "application/mathematica",
246
+ "mbox": "application/mbox",
247
+ "md": "text/markdown",
248
+ "mdx": "text/mdx",
249
+ "me": "text/troff",
250
+ "mesh": "model/mesh",
251
+ "meta4": "application/metalink4+xml",
252
+ "metalink": "application/metalink+xml",
253
+ "mets": "application/mets+xml",
254
+ "mft": "application/rpki-manifest",
255
+ "mid": "audio/midi",
256
+ "midi": "audio/midi",
257
+ "mime": "message/rfc822",
258
+ "mj2": "video/mj2",
259
+ "mjp2": "video/mj2",
260
+ "mjs": "text/javascript",
261
+ "mml": "text/mathml",
262
+ "mods": "application/mods+xml",
263
+ "mov": "video/quicktime",
264
+ "mp2": "audio/mpeg",
265
+ "mp21": "application/mp21",
266
+ "mp2a": "audio/mpeg",
267
+ "mp3": "audio/mpeg",
268
+ "mp4": "video/mp4",
269
+ "mp4a": "audio/mp4",
270
+ "mp4s": "application/mp4",
271
+ "mp4v": "video/mp4",
272
+ "mpd": "application/dash+xml",
273
+ "mpe": "video/mpeg",
274
+ "mpeg": "video/mpeg",
275
+ "mpf": "application/media-policy-dataset+xml",
276
+ "mpg": "video/mpeg",
277
+ "mpg4": "video/mp4",
278
+ "mpga": "audio/mpeg",
279
+ "mpp": "application/dash-patch+xml",
280
+ "mrc": "application/marc",
281
+ "mrcx": "application/marcxml+xml",
282
+ "ms": "text/troff",
283
+ "mscml": "application/mediaservercontrol+xml",
284
+ "msh": "model/mesh",
285
+ "msi": "application/octet-stream",
286
+ "msix": "application/msix",
287
+ "msixbundle": "application/msixbundle",
288
+ "msm": "application/octet-stream",
289
+ "msp": "application/octet-stream",
290
+ "mtl": "model/mtl",
291
+ "musd": "application/mmt-usd+xml",
292
+ "mxf": "application/mxf",
293
+ "mxmf": "audio/mobile-xmf",
294
+ "mxml": "application/xv+xml",
295
+ "n3": "text/n3",
296
+ "nb": "application/mathematica",
297
+ "nq": "application/n-quads",
298
+ "nt": "application/n-triples",
299
+ "obj": "model/obj",
300
+ "oda": "application/oda",
301
+ "oga": "audio/ogg",
302
+ "ogg": "audio/ogg",
303
+ "ogv": "video/ogg",
304
+ "ogx": "application/ogg",
305
+ "omdoc": "application/omdoc+xml",
306
+ "onepkg": "application/onenote",
307
+ "onetmp": "application/onenote",
308
+ "onetoc": "application/onenote",
309
+ "onetoc2": "application/onenote",
310
+ "opf": "application/oebps-package+xml",
311
+ "opus": "audio/ogg",
312
+ "otf": "font/otf",
313
+ "owl": "application/rdf+xml",
314
+ "oxps": "application/oxps",
315
+ "p10": "application/pkcs10",
316
+ "p7c": "application/pkcs7-mime",
317
+ "p7m": "application/pkcs7-mime",
318
+ "p7s": "application/pkcs7-signature",
319
+ "p8": "application/pkcs8",
320
+ "pdf": "application/pdf",
321
+ "pfr": "application/font-tdpfr",
322
+ "pgp": "application/pgp-encrypted",
323
+ "pkg": "application/octet-stream",
324
+ "pki": "application/pkixcmp",
325
+ "pkipath": "application/pkix-pkipath",
326
+ "pls": "application/pls+xml",
327
+ "png": "image/png",
328
+ "prc": "model/prc",
329
+ "prf": "application/pics-rules",
330
+ "provx": "application/provenance+xml",
331
+ "ps": "application/postscript",
332
+ "pskcxml": "application/pskc+xml",
333
+ "pti": "image/prs.pti",
334
+ "qt": "video/quicktime",
335
+ "raml": "application/raml+yaml",
336
+ "rapd": "application/route-apd+xml",
337
+ "rdf": "application/rdf+xml",
338
+ "relo": "application/p2p-overlay+xml",
339
+ "rif": "application/reginfo+xml",
340
+ "rl": "application/resource-lists+xml",
341
+ "rld": "application/resource-lists-diff+xml",
342
+ "rmi": "audio/midi",
343
+ "rnc": "application/relax-ng-compact-syntax",
344
+ "rng": "application/xml",
345
+ "roa": "application/rpki-roa",
346
+ "roff": "text/troff",
347
+ "rq": "application/sparql-query",
348
+ "rs": "application/rls-services+xml",
349
+ "rsat": "application/atsc-rsat+xml",
350
+ "rsd": "application/rsd+xml",
351
+ "rsheet": "application/urc-ressheet+xml",
352
+ "rss": "application/rss+xml",
353
+ "rtf": "text/rtf",
354
+ "rtx": "text/richtext",
355
+ "rusd": "application/route-usd+xml",
356
+ "s3m": "audio/s3m",
357
+ "sbml": "application/sbml+xml",
358
+ "scq": "application/scvp-cv-request",
359
+ "scs": "application/scvp-cv-response",
360
+ "sdp": "application/sdp",
361
+ "senmlx": "application/senml+xml",
362
+ "sensmlx": "application/sensml+xml",
363
+ "ser": "application/java-serialized-object",
364
+ "setpay": "application/set-payment-initiation",
365
+ "setreg": "application/set-registration-initiation",
366
+ "sgi": "image/sgi",
367
+ "sgm": "text/sgml",
368
+ "sgml": "text/sgml",
369
+ "shex": "text/shex",
370
+ "shf": "application/shf+xml",
371
+ "shtml": "text/html",
372
+ "sieve": "application/sieve",
373
+ "sig": "application/pgp-signature",
374
+ "sil": "audio/silk",
375
+ "silo": "model/mesh",
376
+ "siv": "application/sieve",
377
+ "slim": "text/slim",
378
+ "slm": "text/slim",
379
+ "sls": "application/route-s-tsid+xml",
380
+ "smi": "application/smil+xml",
381
+ "smil": "application/smil+xml",
382
+ "snd": "audio/basic",
383
+ "so": "application/octet-stream",
384
+ "spdx": "text/spdx",
385
+ "spp": "application/scvp-vp-response",
386
+ "spq": "application/scvp-vp-request",
387
+ "spx": "audio/ogg",
388
+ "sql": "application/sql",
389
+ "sru": "application/sru+xml",
390
+ "srx": "application/sparql-results+xml",
391
+ "ssdl": "application/ssdl+xml",
392
+ "ssml": "application/ssml+xml",
393
+ "stk": "application/hyperstudio",
394
+ "stl": "model/stl",
395
+ "stpx": "model/step+xml",
396
+ "stpxz": "model/step-xml+zip",
397
+ "stpz": "model/step+zip",
398
+ "styl": "text/stylus",
399
+ "stylus": "text/stylus",
400
+ "svg": "image/svg+xml",
401
+ "svgz": "image/svg+xml",
402
+ "swidtag": "application/swid+xml",
403
+ "t": "text/troff",
404
+ "t38": "image/t38",
405
+ "td": "application/urc-targetdesc+xml",
406
+ "tei": "application/tei+xml",
407
+ "teicorpus": "application/tei+xml",
408
+ "text": "text/plain",
409
+ "tfi": "application/thraud+xml",
410
+ "tfx": "image/tiff-fx",
411
+ "tif": "image/tiff",
412
+ "tiff": "image/tiff",
413
+ "toml": "application/toml",
414
+ "tr": "text/troff",
415
+ "trig": "application/trig",
416
+ "ts": "video/mp2t",
417
+ "tsd": "application/timestamped-data",
418
+ "tsv": "text/tab-separated-values",
419
+ "ttc": "font/collection",
420
+ "ttf": "font/ttf",
421
+ "ttl": "text/turtle",
422
+ "ttml": "application/ttml+xml",
423
+ "txt": "text/plain",
424
+ "u3d": "model/u3d",
425
+ "u8dsn": "message/global-delivery-status",
426
+ "u8hdr": "message/global-headers",
427
+ "u8mdn": "message/global-disposition-notification",
428
+ "u8msg": "message/global",
429
+ "ubj": "application/ubjson",
430
+ "uri": "text/uri-list",
431
+ "uris": "text/uri-list",
432
+ "urls": "text/uri-list",
433
+ "vcard": "text/vcard",
434
+ "vrml": "model/vrml",
435
+ "vtt": "text/vtt",
436
+ "vxml": "application/voicexml+xml",
437
+ "war": "application/java-archive",
438
+ "wasm": "application/wasm",
439
+ "wav": "audio/wav",
440
+ "weba": "audio/webm",
441
+ "webm": "video/webm",
442
+ "webmanifest": "application/manifest+json",
443
+ "webp": "image/webp",
444
+ "wgsl": "text/wgsl",
445
+ "wgt": "application/widget",
446
+ "wif": "application/watcherinfo+xml",
447
+ "wmf": "image/wmf",
448
+ "woff": "font/woff",
449
+ "woff2": "font/woff2",
450
+ "wrl": "model/vrml",
451
+ "wsdl": "application/wsdl+xml",
452
+ "wspolicy": "application/wspolicy+xml",
453
+ "x3d": "model/x3d+xml",
454
+ "x3db": "model/x3d+fastinfoset",
455
+ "x3dbz": "model/x3d+binary",
456
+ "x3dv": "model/x3d-vrml",
457
+ "x3dvz": "model/x3d+vrml",
458
+ "x3dz": "model/x3d+xml",
459
+ "xaml": "application/xaml+xml",
460
+ "xav": "application/xcap-att+xml",
461
+ "xca": "application/xcap-caps+xml",
462
+ "xcs": "application/calendar+xml",
463
+ "xdf": "application/xcap-diff+xml",
464
+ "xdssc": "application/dssc+xml",
465
+ "xel": "application/xcap-el+xml",
466
+ "xenc": "application/xenc+xml",
467
+ "xer": "application/patch-ops-error+xml",
468
+ "xfdf": "application/xfdf",
469
+ "xht": "application/xhtml+xml",
470
+ "xhtml": "application/xhtml+xml",
471
+ "xhvml": "application/xv+xml",
472
+ "xlf": "application/xliff+xml",
473
+ "xm": "audio/xm",
474
+ "xml": "text/xml",
475
+ "xns": "application/xcap-ns+xml",
476
+ "xop": "application/xop+xml",
477
+ "xpl": "application/xproc+xml",
478
+ "xsd": "application/xml",
479
+ "xsf": "application/prs.xsf+xml",
480
+ "xsl": "application/xml",
481
+ "xslt": "application/xml",
482
+ "xspf": "application/xspf+xml",
483
+ "xvm": "application/xv+xml",
484
+ "xvml": "application/xv+xml",
485
+ "yaml": "text/yaml",
486
+ "yang": "application/yang",
487
+ "yin": "application/yin+xml",
488
+ "yml": "text/yaml",
489
+ "zip": "application/zip"
490
+ };
491
+
492
+ function lookup(extn) {
493
+ let tmp = ('' + extn).trim().toLowerCase();
494
+ let idx = tmp.lastIndexOf('.');
495
+ return mimes[!~idx ? tmp : tmp.substring(++idx)];
496
+ }
497
+
498
+ exports.mimes = mimes;
499
+ exports.lookup = lookup;
500
+
501
+
502
+ /***/ }),
503
+
504
+ /***/ 486:
505
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
506
+
507
+ const fs = __nccwpck_require__(147);
508
+ const { join, normalize, resolve } = __nccwpck_require__(17);
509
+ const { totalist } = __nccwpck_require__(190);
510
+ const { parse } = __nccwpck_require__(665);
511
+ const { lookup } = __nccwpck_require__(786);
512
+
513
+ const noop = () => {};
514
+
515
+ function isMatch(uri, arr) {
516
+ for (let i=0; i < arr.length; i++) {
517
+ if (arr[i].test(uri)) return true;
518
+ }
519
+ }
520
+
521
+ function toAssume(uri, extns) {
522
+ let i=0, x, len=uri.length - 1;
523
+ if (uri.charCodeAt(len) === 47) {
524
+ uri = uri.substring(0, len);
525
+ }
526
+
527
+ let arr=[], tmp=`${uri}/index`;
528
+ for (; i < extns.length; i++) {
529
+ x = extns[i] ? `.${extns[i]}` : '';
530
+ if (uri) arr.push(uri + x);
531
+ arr.push(tmp + x);
532
+ }
533
+
534
+ return arr;
535
+ }
536
+
537
+ function viaCache(cache, uri, extns) {
538
+ let i=0, data, arr=toAssume(uri, extns);
539
+ for (; i < arr.length; i++) {
540
+ if (data = cache[arr[i]]) return data;
541
+ }
542
+ }
543
+
544
+ function viaLocal(dir, isEtag, uri, extns) {
545
+ let i=0, arr=toAssume(uri, extns);
546
+ let abs, stats, name, headers;
547
+ for (; i < arr.length; i++) {
548
+ abs = normalize(join(dir, name=arr[i]));
549
+ if (abs.startsWith(dir) && fs.existsSync(abs)) {
550
+ stats = fs.statSync(abs);
551
+ if (stats.isDirectory()) continue;
552
+ headers = toHeaders(name, stats, isEtag);
553
+ headers['Cache-Control'] = isEtag ? 'no-cache' : 'no-store';
554
+ return { abs, stats, headers };
555
+ }
556
+ }
557
+ }
558
+
559
+ function is404(req, res) {
560
+ return (res.statusCode=404,res.end());
561
+ }
562
+
563
+ function send(req, res, file, stats, headers) {
564
+ let code=200, tmp, opts={};
565
+ headers = { ...headers };
566
+
567
+ for (let key in headers) {
568
+ tmp = res.getHeader(key);
569
+ if (tmp) headers[key] = tmp;
570
+ }
571
+
572
+ if (tmp = res.getHeader('content-type')) {
573
+ headers['Content-Type'] = tmp;
574
+ }
575
+
576
+ if (req.headers.range) {
577
+ code = 206;
578
+ let [x, y] = req.headers.range.replace('bytes=', '').split('-');
579
+ let end = opts.end = parseInt(y, 10) || stats.size - 1;
580
+ let start = opts.start = parseInt(x, 10) || 0;
581
+
582
+ if (end >= stats.size) {
583
+ end = stats.size - 1;
584
+ }
585
+
586
+ if (start >= stats.size) {
587
+ res.setHeader('Content-Range', `bytes */${stats.size}`);
588
+ res.statusCode = 416;
589
+ return res.end();
590
+ }
591
+
592
+ headers['Content-Range'] = `bytes ${start}-${end}/${stats.size}`;
593
+ headers['Content-Length'] = (end - start + 1);
594
+ headers['Accept-Ranges'] = 'bytes';
595
+ }
596
+
597
+ res.writeHead(code, headers);
598
+ fs.createReadStream(file, opts).pipe(res);
599
+ }
600
+
601
+ const ENCODING = {
602
+ '.br': 'br',
603
+ '.gz': 'gzip',
604
+ };
605
+
606
+ function toHeaders(name, stats, isEtag) {
607
+ let enc = ENCODING[name.slice(-3)];
608
+
609
+ let ctype = lookup(name.slice(0, enc && -3)) || '';
610
+ if (ctype === 'text/html') ctype += ';charset=utf-8';
611
+
612
+ let headers = {
613
+ 'Content-Length': stats.size,
614
+ 'Content-Type': ctype,
615
+ 'Last-Modified': stats.mtime.toUTCString(),
616
+ };
617
+
618
+ if (enc) headers['Content-Encoding'] = enc;
619
+ if (isEtag) headers['ETag'] = `W/"${stats.size}-${stats.mtime.getTime()}"`;
620
+
621
+ return headers;
622
+ }
623
+
624
+ module.exports = function (dir, opts={}) {
625
+ dir = resolve(dir || '.');
626
+
627
+ let isNotFound = opts.onNoMatch || is404;
628
+ let setHeaders = opts.setHeaders || noop;
629
+
630
+ let extensions = opts.extensions || ['html', 'htm'];
631
+ let gzips = opts.gzip && extensions.map(x => `${x}.gz`).concat('gz');
632
+ let brots = opts.brotli && extensions.map(x => `${x}.br`).concat('br');
633
+
634
+ const FILES = {};
635
+
636
+ let fallback = '/';
637
+ let isEtag = !!opts.etag;
638
+ let isSPA = !!opts.single;
639
+ if (typeof opts.single === 'string') {
640
+ let idx = opts.single.lastIndexOf('.');
641
+ fallback += !!~idx ? opts.single.substring(0, idx) : opts.single;
642
+ }
643
+
644
+ let ignores = [];
645
+ if (opts.ignores !== false) {
646
+ ignores.push(/[/]([A-Za-z\s\d~$._-]+\.\w+){1,}$/); // any extn
647
+ if (opts.dotfiles) ignores.push(/\/\.\w/);
648
+ else ignores.push(/\/\.well-known/);
649
+ [].concat(opts.ignores || []).forEach(x => {
650
+ ignores.push(new RegExp(x, 'i'));
651
+ });
652
+ }
653
+
654
+ let cc = opts.maxAge != null && `public,max-age=${opts.maxAge}`;
655
+ if (cc && opts.immutable) cc += ',immutable';
656
+ else if (cc && opts.maxAge === 0) cc += ',must-revalidate';
657
+
658
+ if (!opts.dev) {
659
+ totalist(dir, (name, abs, stats) => {
660
+ if (/\.well-known[\\+\/]/.test(name)) {} // keep
661
+ else if (!opts.dotfiles && /(^\.|[\\+|\/+]\.)/.test(name)) return;
662
+
663
+ let headers = toHeaders(name, stats, isEtag);
664
+ if (cc) headers['Cache-Control'] = cc;
665
+
666
+ FILES['/' + name.normalize().replace(/\\+/g, '/')] = { abs, stats, headers };
667
+ });
668
+ }
669
+
670
+ let lookup = opts.dev ? viaLocal.bind(0, dir, isEtag) : viaCache.bind(0, FILES);
671
+
672
+ return function (req, res, next) {
673
+ let extns = [''];
674
+ let pathname = parse(req).pathname;
675
+ let val = req.headers['accept-encoding'] || '';
676
+ if (gzips && val.includes('gzip')) extns.unshift(...gzips);
677
+ if (brots && /(br|brotli)/i.test(val)) extns.unshift(...brots);
678
+ extns.push(...extensions); // [...br, ...gz, orig, ...exts]
679
+
680
+ if (pathname.indexOf('%') !== -1) {
681
+ try { pathname = decodeURI(pathname) }
682
+ catch (err) { /* malform uri */ }
683
+ }
684
+
685
+ let data = lookup(pathname, extns) || isSPA && !isMatch(pathname, ignores) && lookup(fallback, extns);
686
+ if (!data) return next ? next() : isNotFound(req, res);
687
+
688
+ if (isEtag && req.headers['if-none-match'] === data.headers['ETag']) {
689
+ res.writeHead(304);
690
+ return res.end();
691
+ }
692
+
693
+ if (gzips || brots) {
694
+ res.setHeader('Vary', 'Accept-Encoding');
695
+ }
696
+
697
+ setHeaders(res, pathname, data.stats);
698
+ send(req, res, data.abs, data.stats, data.headers);
699
+ };
700
+ }
701
+
702
+
703
+ /***/ }),
704
+
705
+ /***/ 190:
706
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
707
+
708
+ const { join, resolve } = __nccwpck_require__(17);
709
+ const { readdirSync, statSync } = __nccwpck_require__(147);
710
+
711
+ function totalist(dir, callback, pre='') {
712
+ dir = resolve('.', dir);
713
+ let arr = readdirSync(dir);
714
+ let i=0, abs, stats;
715
+ for (; i < arr.length; i++) {
716
+ abs = join(dir, arr[i]);
717
+ stats = statSync(abs);
718
+ stats.isDirectory()
719
+ ? totalist(abs, callback, join(pre, arr[i]))
720
+ : callback(join(pre, arr[i]), abs, stats);
721
+ }
722
+ }
723
+
724
+ exports.totalist = totalist;
725
+
726
+ /***/ }),
727
+
728
+ /***/ 147:
729
+ /***/ ((module) => {
730
+
731
+ "use strict";
732
+ module.exports = require("fs");
733
+
734
+ /***/ }),
735
+
736
+ /***/ 17:
737
+ /***/ ((module) => {
738
+
739
+ "use strict";
740
+ module.exports = require("path");
741
+
742
+ /***/ }),
743
+
744
+ /***/ 477:
745
+ /***/ ((module) => {
746
+
747
+ "use strict";
748
+ module.exports = require("querystring");
749
+
750
+ /***/ })
751
+
752
+ /******/ });
753
+ /************************************************************************/
754
+ /******/ // The module cache
755
+ /******/ var __webpack_module_cache__ = {};
756
+ /******/
757
+ /******/ // The require function
758
+ /******/ function __nccwpck_require__(moduleId) {
759
+ /******/ // Check if module is in cache
760
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
761
+ /******/ if (cachedModule !== undefined) {
762
+ /******/ return cachedModule.exports;
763
+ /******/ }
764
+ /******/ // Create a new module (and put it into the cache)
765
+ /******/ var module = __webpack_module_cache__[moduleId] = {
766
+ /******/ // no module.id needed
767
+ /******/ // no module.loaded needed
768
+ /******/ exports: {}
769
+ /******/ };
770
+ /******/
771
+ /******/ // Execute the module function
772
+ /******/ var threw = true;
773
+ /******/ try {
774
+ /******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
775
+ /******/ threw = false;
776
+ /******/ } finally {
777
+ /******/ if(threw) delete __webpack_module_cache__[moduleId];
778
+ /******/ }
779
+ /******/
780
+ /******/ // Return the exports of the module
781
+ /******/ return module.exports;
782
+ /******/ }
783
+ /******/
784
+ /************************************************************************/
785
+ /******/ /* webpack/runtime/compat */
786
+ /******/
787
+ /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
788
+ /******/
789
+ /************************************************************************/
790
+ /******/
791
+ /******/ // startup
792
+ /******/ // Load entry module and return exports
793
+ /******/ // This entry module is referenced by other modules so it can't be inlined
794
+ /******/ var __webpack_exports__ = __nccwpck_require__(486);
795
+ /******/ module.exports = __webpack_exports__;
796
+ /******/
797
+ /******/ })()
798
+ ;