vite 2.7.0 → 2.7.4
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.
Potentially problematic release.
This version of vite might be problematic. Click here for more details.
- package/CHANGELOG.md +78 -29
- package/LICENSE.md +41 -11
- package/dist/client/client.mjs.map +1 -1
- package/dist/node/build.d.ts +200 -0
- package/dist/node/chunks/{dep-58399509.js → dep-2d8e2cb1.js} +1 -1
- package/dist/node/chunks/dep-2d8e2cb1.js.map +1 -0
- package/dist/node/chunks/{dep-4dd87a09.js → dep-a89a79de.js} +2 -2
- package/dist/node/chunks/{dep-4dd87a09.js.map → dep-a89a79de.js.map} +1 -1
- package/dist/node/chunks/{dep-7e125991.js → dep-cb6d7f22.js} +660 -209
- package/dist/node/chunks/dep-cb6d7f22.js.map +1 -0
- package/dist/node/chunks/{dep-1ce37657.js → dep-ef3cdce0.js} +79 -61
- package/dist/node/chunks/dep-ef3cdce0.js.map +1 -0
- package/dist/node/chunks/{dep-4619561c.js → dep-fd7e14cf.js} +2 -2
- package/dist/node/chunks/dep-fd7e14cf.js.map +1 -0
- package/dist/node/cli.d.ts +1 -0
- package/dist/node/cli.js +4 -4
- package/dist/node/cli.js.map +1 -1
- package/dist/node/config.d.ts +202 -0
- package/dist/node/constants.d.ts +33 -0
- package/dist/node/http.d.ts +84 -0
- package/dist/node/importGlob.d.ts +9 -0
- package/dist/node/index.d.ts +317 -322
- package/dist/node/index.js +1 -1
- package/dist/node/logger.d.ts +35 -0
- package/dist/node/optimizer/esbuildDepPlugin.d.ts +4 -0
- package/dist/node/optimizer/index.d.ts +66 -0
- package/dist/node/optimizer/registerMissing.d.ts +2 -0
- package/dist/node/optimizer/scan.d.ts +9 -0
- package/dist/node/packages.d.ts +25 -0
- package/dist/node/plugin.d.ts +115 -0
- package/dist/node/plugins/asset.d.ts +40 -0
- package/dist/node/plugins/assetImportMetaUrl.d.ts +13 -0
- package/dist/node/plugins/clientInjections.d.ts +7 -0
- package/dist/node/plugins/css.d.ts +70 -0
- package/dist/node/plugins/dataUri.d.ts +5 -0
- package/dist/node/plugins/define.d.ts +3 -0
- package/dist/node/plugins/esbuild.d.ts +15 -0
- package/dist/node/plugins/html.d.ts +102 -0
- package/dist/node/plugins/importAnalysis.d.ts +46 -0
- package/dist/node/plugins/importAnalysisBuild.d.ts +15 -0
- package/dist/node/plugins/index.d.ts +3 -0
- package/dist/node/plugins/json.d.ts +22 -0
- package/dist/node/plugins/loadFallback.d.ts +5 -0
- package/dist/node/plugins/manifest.d.ts +14 -0
- package/dist/node/plugins/modulePreloadPolyfill.d.ts +4 -0
- package/dist/node/plugins/preAlias.d.ts +5 -0
- package/dist/node/plugins/reporter.d.ts +3 -0
- package/dist/node/plugins/resolve.d.ts +38 -0
- package/dist/node/plugins/ssrRequireHook.d.ts +12 -0
- package/dist/node/plugins/terser.d.ts +3 -0
- package/dist/node/plugins/wasm.d.ts +3 -0
- package/dist/node/plugins/worker.d.ts +3 -0
- package/dist/node/preview.d.ts +31 -0
- package/dist/node/server/hmr.d.ts +37 -0
- package/dist/node/server/index.d.ts +215 -0
- package/dist/node/server/middlewares/base.d.ts +3 -0
- package/dist/node/server/middlewares/error.d.ts +8 -0
- package/dist/node/server/middlewares/indexHtml.d.ts +4 -0
- package/dist/node/server/middlewares/proxy.d.ts +20 -0
- package/dist/node/server/middlewares/spaFallback.d.ts +2 -0
- package/dist/node/server/middlewares/static.d.ts +6 -0
- package/dist/node/server/middlewares/time.d.ts +2 -0
- package/dist/node/server/middlewares/transform.d.ts +3 -0
- package/dist/node/server/moduleGraph.d.ts +53 -0
- package/dist/node/server/openBrowser.d.ts +15 -0
- package/dist/node/server/pluginContainer.d.ts +37 -0
- package/dist/node/server/searchRoot.d.ts +8 -0
- package/dist/node/server/send.d.ts +4 -0
- package/dist/node/server/sourcemap.d.ts +8 -0
- package/dist/node/server/transformRequest.d.ts +14 -0
- package/dist/node/server/ws.d.ts +14 -0
- package/dist/node/ssr/ssrExternal.d.ts +7 -0
- package/dist/node/ssr/ssrManifestPlugin.d.ts +3 -0
- package/dist/node/ssr/ssrModuleLoader.d.ts +7 -0
- package/dist/node/ssr/ssrStacktrace.d.ts +3 -0
- package/dist/node/ssr/ssrTransform.d.ts +8 -0
- package/dist/node/utils.d.ts +114 -0
- package/package.json +15 -15
- package/src/client/client.ts +2 -2
- package/src/client/overlay.ts +1 -1
- package/types/alias.d.ts +1 -1
- package/types/chokidar.d.ts +2 -2
- package/types/http-proxy.d.ts +4 -4
- package/types/importMeta.d.ts +13 -14
- package/types/shims.d.ts +5 -5
- package/types/ws.d.ts +284 -288
- package/dist/node/chunks/dep-1ce37657.js.map +0 -1
- package/dist/node/chunks/dep-4619561c.js.map +0 -1
- package/dist/node/chunks/dep-58399509.js.map +0 -1
- package/dist/node/chunks/dep-7e125991.js.map +0 -1
|
@@ -2171,7 +2171,7 @@ function setup(env) {
|
|
|
2171
2171
|
|
|
2172
2172
|
/**
|
|
2173
2173
|
* Selects a color for a debug namespace
|
|
2174
|
-
* @param {String} namespace The namespace string for the
|
|
2174
|
+
* @param {String} namespace The namespace string for the debug instance to be colored
|
|
2175
2175
|
* @return {Number|String} An ANSI color code for the given namespace
|
|
2176
2176
|
* @api private
|
|
2177
2177
|
*/
|
|
@@ -3760,7 +3760,7 @@ function buildSourceMapTree(input, loader, relativeRoot) {
|
|
|
3760
3760
|
const maps = asArray(input).map(decodeSourceMap);
|
|
3761
3761
|
const map = maps.pop();
|
|
3762
3762
|
for (let i = 0; i < maps.length; i++) {
|
|
3763
|
-
if (maps[i].sources.length
|
|
3763
|
+
if (maps[i].sources.length > 1) {
|
|
3764
3764
|
throw new Error(`Transformation map ${i} must have exactly one source file.\n` +
|
|
3765
3765
|
'Did you specify these with the most recent transformation maps first?');
|
|
3766
3766
|
}
|
|
@@ -4316,8 +4316,8 @@ function arraify(target) {
|
|
|
4316
4316
|
function toUpperCaseDriveLetter(pathName) {
|
|
4317
4317
|
return pathName.replace(/^\w:/, (letter) => letter.toUpperCase());
|
|
4318
4318
|
}
|
|
4319
|
-
const multilineCommentsRE = /\/\*(.|[\r\n])*?\*\//gm;
|
|
4320
|
-
const singlelineCommentsRE = /\/\/.*/g;
|
|
4319
|
+
const multilineCommentsRE$1 = /\/\*(.|[\r\n])*?\*\//gm;
|
|
4320
|
+
const singlelineCommentsRE$1 = /\/\/.*/g;
|
|
4321
4321
|
const usingDynamicImport = typeof jest === 'undefined';
|
|
4322
4322
|
/**
|
|
4323
4323
|
* Dynamically import files. It will make sure it's not being compiled away by TS/Rollup.
|
|
@@ -5712,7 +5712,7 @@ MagicString.prototype.trimStart = function trimStart (charType) {
|
|
|
5712
5712
|
* @param typeMap [Object] Map of MIME type -> Array[extensions]
|
|
5713
5713
|
* @param ...
|
|
5714
5714
|
*/
|
|
5715
|
-
function Mime$
|
|
5715
|
+
function Mime$1() {
|
|
5716
5716
|
this._types = Object.create(null);
|
|
5717
5717
|
this._extensions = Object.create(null);
|
|
5718
5718
|
|
|
@@ -5744,7 +5744,7 @@ function Mime$3() {
|
|
|
5744
5744
|
* @param map (Object) type definitions
|
|
5745
5745
|
* @param force (Boolean) if true, force overriding of existing definitions
|
|
5746
5746
|
*/
|
|
5747
|
-
Mime$
|
|
5747
|
+
Mime$1.prototype.define = function(typeMap, force) {
|
|
5748
5748
|
for (let type in typeMap) {
|
|
5749
5749
|
let extensions = typeMap[type].map(function(t) {
|
|
5750
5750
|
return t.toLowerCase();
|
|
@@ -5783,7 +5783,7 @@ Mime$3.prototype.define = function(typeMap, force) {
|
|
|
5783
5783
|
/**
|
|
5784
5784
|
* Lookup a mime type based on extension
|
|
5785
5785
|
*/
|
|
5786
|
-
Mime$
|
|
5786
|
+
Mime$1.prototype.getType = function(path) {
|
|
5787
5787
|
path = String(path);
|
|
5788
5788
|
let last = path.replace(/^.*[/\\]/, '').toLowerCase();
|
|
5789
5789
|
let ext = last.replace(/^.*\./, '').toLowerCase();
|
|
@@ -5797,17 +5797,17 @@ Mime$3.prototype.getType = function(path) {
|
|
|
5797
5797
|
/**
|
|
5798
5798
|
* Return file extension associated with a mime type
|
|
5799
5799
|
*/
|
|
5800
|
-
Mime$
|
|
5800
|
+
Mime$1.prototype.getExtension = function(type) {
|
|
5801
5801
|
type = /^\s*([^;\s]*)/.test(type) && RegExp.$1;
|
|
5802
5802
|
return type && this._extensions[type.toLowerCase()] || null;
|
|
5803
5803
|
};
|
|
5804
5804
|
|
|
5805
|
-
var Mime_1
|
|
5805
|
+
var Mime_1 = Mime$1;
|
|
5806
5806
|
|
|
5807
|
-
var standard
|
|
5807
|
+
var standard = {"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};
|
|
5808
5808
|
|
|
5809
|
-
let Mime
|
|
5810
|
-
var lite
|
|
5809
|
+
let Mime = Mime_1;
|
|
5810
|
+
var lite = new Mime(standard);
|
|
5811
5811
|
|
|
5812
5812
|
const assetUrlRE = /__VITE_ASSET__([a-z\d]{8})__(?:\$_(.*?)__)?/g;
|
|
5813
5813
|
const rawRE = /(\?|&)raw(?:&|$)/;
|
|
@@ -6033,7 +6033,7 @@ async function fileToBuiltUrl(id, config, pluginContext, skipPublicCheck = false
|
|
|
6033
6033
|
(!file.endsWith('.svg') &&
|
|
6034
6034
|
content.length < Number(config.build.assetsInlineLimit))) {
|
|
6035
6035
|
// base64 inlined as a string
|
|
6036
|
-
url = `data:${lite
|
|
6036
|
+
url = `data:${lite.getType(file)};base64,${content.toString('base64')}`;
|
|
6037
6037
|
}
|
|
6038
6038
|
else {
|
|
6039
6039
|
// emit as asset
|
|
@@ -20099,13 +20099,14 @@ function cssPostPlugin(config) {
|
|
|
20099
20099
|
return `export default ${JSON.stringify(css)}`;
|
|
20100
20100
|
}
|
|
20101
20101
|
return [
|
|
20102
|
-
`import { updateStyle, removeStyle } from ${JSON.stringify(path__default.posix.join(config.base, CLIENT_PUBLIC_PATH))}`,
|
|
20103
|
-
`const
|
|
20104
|
-
`const
|
|
20105
|
-
`
|
|
20102
|
+
`import { updateStyle as __vite__updateStyle, removeStyle as __vite__removeStyle } from ${JSON.stringify(path__default.posix.join(config.base, CLIENT_PUBLIC_PATH))}`,
|
|
20103
|
+
`const __vite__id = ${JSON.stringify(id)}`,
|
|
20104
|
+
`const __vite__css = ${JSON.stringify(css)}`,
|
|
20105
|
+
`__vite__updateStyle(__vite__id, __vite__css)`,
|
|
20106
20106
|
// css modules exports change on edit so it can't self accept
|
|
20107
|
-
`${modulesCode ||
|
|
20108
|
-
|
|
20107
|
+
`${modulesCode ||
|
|
20108
|
+
`import.meta.hot.accept()\nexport default __vite__css`}`,
|
|
20109
|
+
`import.meta.hot.prune(() => __vite__removeStyle(__vite__id))`
|
|
20109
20110
|
].join('\n');
|
|
20110
20111
|
}
|
|
20111
20112
|
}
|
|
@@ -20382,7 +20383,7 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
|
|
|
20382
20383
|
const postcssOptions = (postcssConfig && postcssConfig.options) || {};
|
|
20383
20384
|
const postcssPlugins = postcssConfig && postcssConfig.plugins ? postcssConfig.plugins.slice() : [];
|
|
20384
20385
|
if (needInlineImport) {
|
|
20385
|
-
postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-
|
|
20386
|
+
postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-2d8e2cb1.js'); }).then(function (n) { return n.index; })).default({
|
|
20386
20387
|
async resolve(id, basedir) {
|
|
20387
20388
|
const resolved = await atImportResolvers.css(id, path__default.join(basedir, '*'));
|
|
20388
20389
|
if (resolved) {
|
|
@@ -20396,7 +20397,7 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
|
|
|
20396
20397
|
replacer: urlReplacer
|
|
20397
20398
|
}));
|
|
20398
20399
|
if (isModule) {
|
|
20399
|
-
postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-
|
|
20400
|
+
postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-fd7e14cf.js'); }).then(function (n) { return n.index; })).default({
|
|
20400
20401
|
...modulesOptions,
|
|
20401
20402
|
getJSON(cssFileName, _modules, outputFileName) {
|
|
20402
20403
|
modules = _modules;
|
|
@@ -20976,7 +20977,34 @@ function lexGlobPattern(code, pos) {
|
|
|
20976
20977
|
throw new Error('unknown import.meta.glob lexer state');
|
|
20977
20978
|
}
|
|
20978
20979
|
}
|
|
20979
|
-
|
|
20980
|
+
const endIndex = getEndIndex(code, i);
|
|
20981
|
+
return [pattern, endIndex + 1];
|
|
20982
|
+
}
|
|
20983
|
+
// reg without the 'g' option, only matches the first match
|
|
20984
|
+
const multilineCommentsRE = /\/\*(.|[\r\n])*?\*\//m;
|
|
20985
|
+
const singlelineCommentsRE = /\/\/.*/;
|
|
20986
|
+
function getEndIndex(code, i) {
|
|
20987
|
+
var _a;
|
|
20988
|
+
const findStart = i;
|
|
20989
|
+
const endIndex = code.indexOf(`)`, findStart);
|
|
20990
|
+
const subCode = code.substring(findStart);
|
|
20991
|
+
const matched = (_a = subCode.match(singlelineCommentsRE)) !== null && _a !== void 0 ? _a : subCode.match(multilineCommentsRE);
|
|
20992
|
+
if (!matched) {
|
|
20993
|
+
return endIndex;
|
|
20994
|
+
}
|
|
20995
|
+
const str = matched[0];
|
|
20996
|
+
const index = matched.index;
|
|
20997
|
+
if (!index) {
|
|
20998
|
+
return endIndex;
|
|
20999
|
+
}
|
|
21000
|
+
const commentStart = findStart + index;
|
|
21001
|
+
const commentEnd = commentStart + str.length;
|
|
21002
|
+
if (endIndex > commentStart && endIndex < commentEnd) {
|
|
21003
|
+
return getEndIndex(code, commentEnd);
|
|
21004
|
+
}
|
|
21005
|
+
else {
|
|
21006
|
+
return endIndex;
|
|
21007
|
+
}
|
|
20980
21008
|
}
|
|
20981
21009
|
function error$3(pos) {
|
|
20982
21010
|
const err = new Error(`import.meta.glob() can only accept string literals.`);
|
|
@@ -21342,7 +21370,7 @@ function htmlInlineScriptProxyPlugin(config) {
|
|
|
21342
21370
|
const file = cleanUrl(id);
|
|
21343
21371
|
const url = file.replace(normalizePath$4(config.root), '');
|
|
21344
21372
|
const result = htmlProxyMap.get(config).get(url)[index];
|
|
21345
|
-
if (result) {
|
|
21373
|
+
if (typeof result === 'string') {
|
|
21346
21374
|
return result;
|
|
21347
21375
|
}
|
|
21348
21376
|
else {
|
|
@@ -21374,7 +21402,7 @@ const assetAttrsConfig = {
|
|
|
21374
21402
|
const isAsyncScriptMap = new WeakMap();
|
|
21375
21403
|
async function traverseHtml(html, filePath, visitor) {
|
|
21376
21404
|
// lazy load compiler
|
|
21377
|
-
const { parse, transform } = await Promise.resolve().then(function () { return require('./dep-
|
|
21405
|
+
const { parse, transform } = await Promise.resolve().then(function () { return require('./dep-ef3cdce0.js'); }).then(function (n) { return n.compilerDom_cjs; });
|
|
21378
21406
|
// @vue/compiler-core doesn't like lowercase doctypes
|
|
21379
21407
|
html = html.replace(/<!doctype\s/i, '<!DOCTYPE ');
|
|
21380
21408
|
try {
|
|
@@ -21384,12 +21412,7 @@ async function traverseHtml(html, filePath, visitor) {
|
|
|
21384
21412
|
});
|
|
21385
21413
|
}
|
|
21386
21414
|
catch (e) {
|
|
21387
|
-
|
|
21388
|
-
loc: filePath,
|
|
21389
|
-
frame: '',
|
|
21390
|
-
...formatParseError(e, filePath, html)
|
|
21391
|
-
};
|
|
21392
|
-
throw new Error(`Unable to parse ${JSON.stringify(parseError.loc)}\n${parseError.frame}`);
|
|
21415
|
+
handleParseError(e, html, filePath);
|
|
21393
21416
|
}
|
|
21394
21417
|
}
|
|
21395
21418
|
function getScriptInfo(node) {
|
|
@@ -21412,17 +21435,28 @@ function getScriptInfo(node) {
|
|
|
21412
21435
|
}
|
|
21413
21436
|
return { src, isModule, isAsync };
|
|
21414
21437
|
}
|
|
21415
|
-
|
|
21416
|
-
|
|
21417
|
-
|
|
21418
|
-
|
|
21419
|
-
|
|
21438
|
+
/**
|
|
21439
|
+
* Format Vue @type {CompilerError} to @type {RollupError}
|
|
21440
|
+
*/
|
|
21441
|
+
function formatParseError(compilerError, id, html) {
|
|
21442
|
+
const formattedError = { ...compilerError };
|
|
21443
|
+
if (compilerError.loc) {
|
|
21444
|
+
formattedError.frame = generateCodeFrame(html, compilerError.loc.start.offset);
|
|
21445
|
+
formattedError.loc = {
|
|
21420
21446
|
file: id,
|
|
21421
|
-
line:
|
|
21422
|
-
column:
|
|
21447
|
+
line: compilerError.loc.start.line,
|
|
21448
|
+
column: compilerError.loc.start.column
|
|
21423
21449
|
};
|
|
21424
21450
|
}
|
|
21425
|
-
return
|
|
21451
|
+
return formattedError;
|
|
21452
|
+
}
|
|
21453
|
+
function handleParseError(compilerError, html, filePath) {
|
|
21454
|
+
const parseError = {
|
|
21455
|
+
loc: filePath,
|
|
21456
|
+
frame: '',
|
|
21457
|
+
...formatParseError(compilerError, filePath, html)
|
|
21458
|
+
};
|
|
21459
|
+
throw new Error(`Unable to parse HTML; ${compilerError.message}\n at ${JSON.stringify(parseError.loc)}\n${parseError.frame}`);
|
|
21426
21460
|
}
|
|
21427
21461
|
/**
|
|
21428
21462
|
* Compiles index.html into an entry js module
|
|
@@ -21440,6 +21474,7 @@ function buildHtmlPlugin(config) {
|
|
|
21440
21474
|
isAsyncScriptMap.set(config, new Map());
|
|
21441
21475
|
},
|
|
21442
21476
|
async transform(html, id) {
|
|
21477
|
+
var _a, _b;
|
|
21443
21478
|
if (id.endsWith('.html')) {
|
|
21444
21479
|
const publicPath = `/${slash$3(path__default.relative(config.root, id))}`;
|
|
21445
21480
|
// pre-transform
|
|
@@ -21530,20 +21565,26 @@ function buildHtmlPlugin(config) {
|
|
|
21530
21565
|
config.logger.warn(`\nMixed async and defer script modules in ${id}, output script will fallback to defer. Every script, including inline ones, need to be marked as async for your output script to be async.`);
|
|
21531
21566
|
}
|
|
21532
21567
|
// for each encountered asset url, rewrite original html so that it
|
|
21533
|
-
// references the post-build location
|
|
21568
|
+
// references the post-build location, ignoring empty attributes and
|
|
21569
|
+
// attributes that directly reference named output.
|
|
21570
|
+
const namedOutput = Object.keys(((_b = (_a = config === null || config === void 0 ? void 0 : config.build) === null || _a === void 0 ? void 0 : _a.rollupOptions) === null || _b === void 0 ? void 0 : _b.input) || {});
|
|
21534
21571
|
for (const attr of assetUrls) {
|
|
21535
21572
|
const value = attr.value;
|
|
21536
|
-
|
|
21537
|
-
|
|
21538
|
-
|
|
21539
|
-
|
|
21540
|
-
|
|
21541
|
-
|
|
21542
|
-
|
|
21543
|
-
|
|
21544
|
-
|
|
21545
|
-
|
|
21546
|
-
|
|
21573
|
+
const content = value.content;
|
|
21574
|
+
if (content !== '' && // Empty attribute
|
|
21575
|
+
!namedOutput.includes(content) && // Direct reference to named output
|
|
21576
|
+
!namedOutput.includes(content.replace(/^\//, '')) // Allow for absolute references as named output can't be an absolute path
|
|
21577
|
+
) {
|
|
21578
|
+
try {
|
|
21579
|
+
const url = attr.name === 'srcset'
|
|
21580
|
+
? await processSrcSet(content, ({ url }) => urlToBuiltUrl(url, id, config, this))
|
|
21581
|
+
: await urlToBuiltUrl(content, id, config, this);
|
|
21582
|
+
s.overwrite(value.loc.start.offset, value.loc.end.offset, `"${url}"`);
|
|
21583
|
+
}
|
|
21584
|
+
catch (e) {
|
|
21585
|
+
if (e.code !== 'ENOENT') {
|
|
21586
|
+
throw e;
|
|
21587
|
+
}
|
|
21547
21588
|
}
|
|
21548
21589
|
}
|
|
21549
21590
|
}
|
|
@@ -30731,6 +30772,7 @@ function resolveSSRExternal(config, knownImports) {
|
|
|
30731
30772
|
}
|
|
30732
30773
|
return externals;
|
|
30733
30774
|
}
|
|
30775
|
+
const CJS_CONTENT_RE = /\bmodule\.exports\b|\bexports[.\[]|\brequire\s*\(|\bObject\.(defineProperty|defineProperties|assign)\s*\(\s*exports\b/;
|
|
30734
30776
|
// do we need to do this ahead of time or could we do it lazily?
|
|
30735
30777
|
function collectExternals(root, preserveSymlinks, ssrExternals, seen, logger) {
|
|
30736
30778
|
var _a;
|
|
@@ -30809,11 +30851,11 @@ function collectExternals(root, preserveSymlinks, ssrExternals, seen, logger) {
|
|
|
30809
30851
|
}
|
|
30810
30852
|
// check if the entry is cjs
|
|
30811
30853
|
const content = fs__default.readFileSync(esmEntry, 'utf-8');
|
|
30812
|
-
if (
|
|
30854
|
+
if (CJS_CONTENT_RE.test(content)) {
|
|
30813
30855
|
ssrExternals.add(id);
|
|
30814
30856
|
continue;
|
|
30815
30857
|
}
|
|
30816
|
-
logger.warn(`${id}
|
|
30858
|
+
logger.warn(`${id} doesn't appear to be written in CJS, but also doesn't appear to be a valid ES module (i.e. it doesn't have "type": "module" or an .mjs extension for the entry point). Please contact the package author to fix.`);
|
|
30817
30859
|
}
|
|
30818
30860
|
}
|
|
30819
30861
|
for (const depRoot of depsToTrace) {
|
|
@@ -43198,8 +43240,8 @@ async function transformGlob(source, importer, root, loader) {
|
|
|
43198
43240
|
function extractImportPaths(code) {
|
|
43199
43241
|
// empty singleline & multiline comments to avoid matching comments
|
|
43200
43242
|
code = code
|
|
43201
|
-
.replace(multilineCommentsRE, '/* */')
|
|
43202
|
-
.replace(singlelineCommentsRE, '');
|
|
43243
|
+
.replace(multilineCommentsRE$1, '/* */')
|
|
43244
|
+
.replace(singlelineCommentsRE$1, '');
|
|
43203
43245
|
let js = '';
|
|
43204
43246
|
let m;
|
|
43205
43247
|
while ((m = importsRE.exec(code)) != null) {
|
|
@@ -43244,8 +43286,8 @@ function assetImportMetaUrlPlugin(config) {
|
|
|
43244
43286
|
if (code.includes('new URL') && code.includes(`import.meta.url`)) {
|
|
43245
43287
|
const importMetaUrlRE = /\bnew\s+URL\s*\(\s*('[^']+'|"[^"]+"|`[^`]+`)\s*,\s*import\.meta\.url\s*\)/g;
|
|
43246
43288
|
const noCommentsCode = code
|
|
43247
|
-
.replace(multilineCommentsRE, (m) => ' '.repeat(m.length))
|
|
43248
|
-
.replace(singlelineCommentsRE, (m) => ' '.repeat(m.length));
|
|
43289
|
+
.replace(multilineCommentsRE$1, (m) => ' '.repeat(m.length))
|
|
43290
|
+
.replace(singlelineCommentsRE$1, (m) => ' '.repeat(m.length));
|
|
43249
43291
|
let s = null;
|
|
43250
43292
|
let match;
|
|
43251
43293
|
while ((match = importMetaUrlRE.exec(noCommentsCode))) {
|
|
@@ -43322,7 +43364,7 @@ function loadFallbackPlugin() {
|
|
|
43322
43364
|
};
|
|
43323
43365
|
}
|
|
43324
43366
|
|
|
43325
|
-
function resolveBuildOptions(root, raw) {
|
|
43367
|
+
function resolveBuildOptions(root, raw, isBuild) {
|
|
43326
43368
|
var _a;
|
|
43327
43369
|
const resolved = {
|
|
43328
43370
|
target: 'modules',
|
|
@@ -43371,18 +43413,22 @@ function resolveBuildOptions(root, raw) {
|
|
|
43371
43413
|
]))
|
|
43372
43414
|
: resolve(raw.rollupOptions.input);
|
|
43373
43415
|
}
|
|
43374
|
-
else {
|
|
43375
|
-
input = resolve(
|
|
43376
|
-
|
|
43377
|
-
|
|
43378
|
-
|
|
43379
|
-
|
|
43416
|
+
else if ((raw === null || raw === void 0 ? void 0 : raw.lib) && isBuild) {
|
|
43417
|
+
input = resolve(raw.lib.entry);
|
|
43418
|
+
}
|
|
43419
|
+
else if (typeof (raw === null || raw === void 0 ? void 0 : raw.ssr) === 'string') {
|
|
43420
|
+
input = resolve(raw.ssr);
|
|
43421
|
+
}
|
|
43422
|
+
else if (isBuild) {
|
|
43423
|
+
input = resolve('index.html');
|
|
43380
43424
|
}
|
|
43381
43425
|
if (!!(raw === null || raw === void 0 ? void 0 : raw.ssr) && typeof input === 'string' && input.endsWith('.html')) {
|
|
43382
43426
|
throw new Error(`rollupOptions.input should not be an html file when building for SSR. ` +
|
|
43383
43427
|
`Please specify a dedicated SSR entry.`);
|
|
43384
43428
|
}
|
|
43385
|
-
|
|
43429
|
+
if (input) {
|
|
43430
|
+
resolved.rollupOptions.input = input;
|
|
43431
|
+
}
|
|
43386
43432
|
// handle special build targets
|
|
43387
43433
|
if (resolved.target === 'modules') {
|
|
43388
43434
|
// Support browserslist
|
|
@@ -43422,7 +43468,7 @@ function resolveBuildPlugins(config) {
|
|
|
43422
43468
|
dynamicImportVariables(options.dynamicImportVarsOptions),
|
|
43423
43469
|
assetImportMetaUrlPlugin(config),
|
|
43424
43470
|
...(options.rollupOptions.plugins
|
|
43425
|
-
? options.rollupOptions.plugins.filter(
|
|
43471
|
+
? options.rollupOptions.plugins.filter(Boolean)
|
|
43426
43472
|
: [])
|
|
43427
43473
|
],
|
|
43428
43474
|
post: [
|
|
@@ -49533,7 +49579,7 @@ function readFileIfExists(value) {
|
|
|
49533
49579
|
* https://github.com/webpack/webpack-dev-server/blob/master/LICENSE
|
|
49534
49580
|
*/
|
|
49535
49581
|
async function createCertificate() {
|
|
49536
|
-
const { generate } = await Promise.resolve().then(function () { return require('./dep-
|
|
49582
|
+
const { generate } = await Promise.resolve().then(function () { return require('./dep-a89a79de.js'); }).then(function (n) { return n.index; });
|
|
49537
49583
|
const pems = generate(null, {
|
|
49538
49584
|
algorithm: 'sha256',
|
|
49539
49585
|
days: 30,
|
|
@@ -51157,8 +51203,8 @@ class Sender$1 {
|
|
|
51157
51203
|
if (payloadLength === 126) {
|
|
51158
51204
|
target.writeUInt16BE(data.length, 2);
|
|
51159
51205
|
} else if (payloadLength === 127) {
|
|
51160
|
-
target
|
|
51161
|
-
target.
|
|
51206
|
+
target[2] = target[3] = 0;
|
|
51207
|
+
target.writeUIntBE(data.length, 4, 6);
|
|
51162
51208
|
}
|
|
51163
51209
|
|
|
51164
51210
|
if (!options.mask) return [target, data];
|
|
@@ -52027,6 +52073,7 @@ class WebSocket$1 extends EventEmitter$1 {
|
|
|
52027
52073
|
this._closeMessage = EMPTY_BUFFER;
|
|
52028
52074
|
this._closeTimer = null;
|
|
52029
52075
|
this._extensions = {};
|
|
52076
|
+
this._paused = false;
|
|
52030
52077
|
this._protocol = '';
|
|
52031
52078
|
this._readyState = WebSocket$1.CONNECTING;
|
|
52032
52079
|
this._receiver = null;
|
|
@@ -52093,6 +52140,13 @@ class WebSocket$1 extends EventEmitter$1 {
|
|
|
52093
52140
|
return Object.keys(this._extensions).join();
|
|
52094
52141
|
}
|
|
52095
52142
|
|
|
52143
|
+
/**
|
|
52144
|
+
* @type {Boolean}
|
|
52145
|
+
*/
|
|
52146
|
+
get isPaused() {
|
|
52147
|
+
return this._paused;
|
|
52148
|
+
}
|
|
52149
|
+
|
|
52096
52150
|
/**
|
|
52097
52151
|
* @type {Function}
|
|
52098
52152
|
*/
|
|
@@ -52281,6 +52335,23 @@ class WebSocket$1 extends EventEmitter$1 {
|
|
|
52281
52335
|
);
|
|
52282
52336
|
}
|
|
52283
52337
|
|
|
52338
|
+
/**
|
|
52339
|
+
* Pause the socket.
|
|
52340
|
+
*
|
|
52341
|
+
* @public
|
|
52342
|
+
*/
|
|
52343
|
+
pause() {
|
|
52344
|
+
if (
|
|
52345
|
+
this.readyState === WebSocket$1.CONNECTING ||
|
|
52346
|
+
this.readyState === WebSocket$1.CLOSED
|
|
52347
|
+
) {
|
|
52348
|
+
return;
|
|
52349
|
+
}
|
|
52350
|
+
|
|
52351
|
+
this._paused = true;
|
|
52352
|
+
this._socket.pause();
|
|
52353
|
+
}
|
|
52354
|
+
|
|
52284
52355
|
/**
|
|
52285
52356
|
* Send a ping.
|
|
52286
52357
|
*
|
|
@@ -52345,6 +52416,23 @@ class WebSocket$1 extends EventEmitter$1 {
|
|
|
52345
52416
|
this._sender.pong(data || EMPTY_BUFFER, mask, cb);
|
|
52346
52417
|
}
|
|
52347
52418
|
|
|
52419
|
+
/**
|
|
52420
|
+
* Resume the socket.
|
|
52421
|
+
*
|
|
52422
|
+
* @public
|
|
52423
|
+
*/
|
|
52424
|
+
resume() {
|
|
52425
|
+
if (
|
|
52426
|
+
this.readyState === WebSocket$1.CONNECTING ||
|
|
52427
|
+
this.readyState === WebSocket$1.CLOSED
|
|
52428
|
+
) {
|
|
52429
|
+
return;
|
|
52430
|
+
}
|
|
52431
|
+
|
|
52432
|
+
this._paused = false;
|
|
52433
|
+
if (!this._receiver._writableState.needDrain) this._socket.resume();
|
|
52434
|
+
}
|
|
52435
|
+
|
|
52348
52436
|
/**
|
|
52349
52437
|
* Send a data message.
|
|
52350
52438
|
*
|
|
@@ -52487,6 +52575,7 @@ Object.defineProperty(WebSocket$1.prototype, 'CLOSED', {
|
|
|
52487
52575
|
'binaryType',
|
|
52488
52576
|
'bufferedAmount',
|
|
52489
52577
|
'extensions',
|
|
52578
|
+
'isPaused',
|
|
52490
52579
|
'protocol',
|
|
52491
52580
|
'readyState',
|
|
52492
52581
|
'url'
|
|
@@ -52599,19 +52688,26 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
52599
52688
|
|
|
52600
52689
|
const isSecure = parsedUrl.protocol === 'wss:';
|
|
52601
52690
|
const isUnixSocket = parsedUrl.protocol === 'ws+unix:';
|
|
52691
|
+
let invalidURLMessage;
|
|
52602
52692
|
|
|
52603
52693
|
if (parsedUrl.protocol !== 'ws:' && !isSecure && !isUnixSocket) {
|
|
52604
|
-
|
|
52605
|
-
'The URL\'s protocol must be one of "ws:", "wss:", or "ws+unix:"'
|
|
52606
|
-
|
|
52694
|
+
invalidURLMessage =
|
|
52695
|
+
'The URL\'s protocol must be one of "ws:", "wss:", or "ws+unix:"';
|
|
52696
|
+
} else if (isUnixSocket && !parsedUrl.pathname) {
|
|
52697
|
+
invalidURLMessage = "The URL's pathname is empty";
|
|
52698
|
+
} else if (parsedUrl.hash) {
|
|
52699
|
+
invalidURLMessage = 'The URL contains a fragment identifier';
|
|
52607
52700
|
}
|
|
52608
52701
|
|
|
52609
|
-
if (
|
|
52610
|
-
|
|
52611
|
-
}
|
|
52702
|
+
if (invalidURLMessage) {
|
|
52703
|
+
const err = new SyntaxError(invalidURLMessage);
|
|
52612
52704
|
|
|
52613
|
-
|
|
52614
|
-
|
|
52705
|
+
if (websocket._redirects === 0) {
|
|
52706
|
+
throw err;
|
|
52707
|
+
} else {
|
|
52708
|
+
emitErrorAndClose(websocket, err);
|
|
52709
|
+
return;
|
|
52710
|
+
}
|
|
52615
52711
|
}
|
|
52616
52712
|
|
|
52617
52713
|
const defaultPort = isSecure ? 443 : 80;
|
|
@@ -52693,9 +52789,7 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
52693
52789
|
if (req === null || req.aborted) return;
|
|
52694
52790
|
|
|
52695
52791
|
req = websocket._req = null;
|
|
52696
|
-
websocket
|
|
52697
|
-
websocket.emit('error', err);
|
|
52698
|
-
websocket.emitClose();
|
|
52792
|
+
emitErrorAndClose(websocket, err);
|
|
52699
52793
|
});
|
|
52700
52794
|
|
|
52701
52795
|
req.on('response', (res) => {
|
|
@@ -52715,7 +52809,15 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
52715
52809
|
|
|
52716
52810
|
req.abort();
|
|
52717
52811
|
|
|
52718
|
-
|
|
52812
|
+
let addr;
|
|
52813
|
+
|
|
52814
|
+
try {
|
|
52815
|
+
addr = new URL$2(location, address);
|
|
52816
|
+
} catch (e) {
|
|
52817
|
+
const err = new SyntaxError(`Invalid URL: ${location}`);
|
|
52818
|
+
emitErrorAndClose(websocket, err);
|
|
52819
|
+
return;
|
|
52820
|
+
}
|
|
52719
52821
|
|
|
52720
52822
|
initAsClient(websocket, addr, protocols, options);
|
|
52721
52823
|
} else if (!websocket.emit('unexpected-response', req, res)) {
|
|
@@ -52818,6 +52920,19 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
52818
52920
|
});
|
|
52819
52921
|
}
|
|
52820
52922
|
|
|
52923
|
+
/**
|
|
52924
|
+
* Emit the `'error'` and `'close'` event.
|
|
52925
|
+
*
|
|
52926
|
+
* @param {WebSocket} websocket The WebSocket instance
|
|
52927
|
+
* @param {Error} The error to emit
|
|
52928
|
+
* @private
|
|
52929
|
+
*/
|
|
52930
|
+
function emitErrorAndClose(websocket, err) {
|
|
52931
|
+
websocket._readyState = WebSocket$1.CLOSING;
|
|
52932
|
+
websocket.emit('error', err);
|
|
52933
|
+
websocket.emitClose();
|
|
52934
|
+
}
|
|
52935
|
+
|
|
52821
52936
|
/**
|
|
52822
52937
|
* Create a `net.Socket` and initiate a connection.
|
|
52823
52938
|
*
|
|
@@ -52944,7 +53059,9 @@ function receiverOnConclude(code, reason) {
|
|
|
52944
53059
|
* @private
|
|
52945
53060
|
*/
|
|
52946
53061
|
function receiverOnDrain() {
|
|
52947
|
-
this[kWebSocket$1]
|
|
53062
|
+
const websocket = this[kWebSocket$1];
|
|
53063
|
+
|
|
53064
|
+
if (!websocket.isPaused) websocket._socket.resume();
|
|
52948
53065
|
}
|
|
52949
53066
|
|
|
52950
53067
|
/**
|
|
@@ -53737,6 +53854,9 @@ function createWebSocketServer(server, config, httpsOptions) {
|
|
|
53737
53854
|
},
|
|
53738
53855
|
close() {
|
|
53739
53856
|
return new Promise((resolve, reject) => {
|
|
53857
|
+
wss.clients.forEach((client) => {
|
|
53858
|
+
client.terminate();
|
|
53859
|
+
});
|
|
53740
53860
|
wss.close((err) => {
|
|
53741
53861
|
if (err) {
|
|
53742
53862
|
reject(err);
|
|
@@ -56724,7 +56844,8 @@ function walk(root, { onIdentifier, onImportMeta, onDynamicImport }) {
|
|
|
56724
56844
|
if (((parent === null || parent === void 0 ? void 0 : parent.type) === 'AssignmentPattern' &&
|
|
56725
56845
|
(parent === null || parent === void 0 ? void 0 : parent.right) === child) ||
|
|
56726
56846
|
((parent === null || parent === void 0 ? void 0 : parent.type) === 'TemplateLiteral' &&
|
|
56727
|
-
(parent === null || parent === void 0 ? void 0 : parent.expressions.includes(child)))
|
|
56847
|
+
(parent === null || parent === void 0 ? void 0 : parent.expressions.includes(child))) ||
|
|
56848
|
+
((parent === null || parent === void 0 ? void 0 : parent.type) === 'CallExpression' && (parent === null || parent === void 0 ? void 0 : parent.callee) === child)) {
|
|
56728
56849
|
return;
|
|
56729
56850
|
}
|
|
56730
56851
|
setScope(node, child.name);
|
|
@@ -56748,7 +56869,7 @@ function walk(root, { onIdentifier, onImportMeta, onDynamicImport }) {
|
|
|
56748
56869
|
});
|
|
56749
56870
|
}
|
|
56750
56871
|
else if (node.id.type === 'ArrayPattern') {
|
|
56751
|
-
node.id.elements.forEach((element) => {
|
|
56872
|
+
node.id.elements.filter(Boolean).forEach((element) => {
|
|
56752
56873
|
setScope(parentFunction, element.name);
|
|
56753
56874
|
});
|
|
56754
56875
|
}
|
|
@@ -56939,107 +57060,421 @@ function list(dir, callback, pre='') {
|
|
|
56939
57060
|
}
|
|
56940
57061
|
}
|
|
56941
57062
|
|
|
56942
|
-
|
|
56943
|
-
|
|
56944
|
-
|
|
56945
|
-
|
|
56946
|
-
|
|
56947
|
-
|
|
56948
|
-
|
|
56949
|
-
|
|
56950
|
-
|
|
56951
|
-
|
|
56952
|
-
|
|
56953
|
-
|
|
56954
|
-
|
|
56955
|
-
|
|
56956
|
-
|
|
57063
|
+
const mimes = {
|
|
57064
|
+
"ez": "application/andrew-inset",
|
|
57065
|
+
"aw": "application/applixware",
|
|
57066
|
+
"atom": "application/atom+xml",
|
|
57067
|
+
"atomcat": "application/atomcat+xml",
|
|
57068
|
+
"atomdeleted": "application/atomdeleted+xml",
|
|
57069
|
+
"atomsvc": "application/atomsvc+xml",
|
|
57070
|
+
"dwd": "application/atsc-dwd+xml",
|
|
57071
|
+
"held": "application/atsc-held+xml",
|
|
57072
|
+
"rsat": "application/atsc-rsat+xml",
|
|
57073
|
+
"bdoc": "application/bdoc",
|
|
57074
|
+
"xcs": "application/calendar+xml",
|
|
57075
|
+
"ccxml": "application/ccxml+xml",
|
|
57076
|
+
"cdfx": "application/cdfx+xml",
|
|
57077
|
+
"cdmia": "application/cdmi-capability",
|
|
57078
|
+
"cdmic": "application/cdmi-container",
|
|
57079
|
+
"cdmid": "application/cdmi-domain",
|
|
57080
|
+
"cdmio": "application/cdmi-object",
|
|
57081
|
+
"cdmiq": "application/cdmi-queue",
|
|
57082
|
+
"cu": "application/cu-seeme",
|
|
57083
|
+
"mpd": "application/dash+xml",
|
|
57084
|
+
"davmount": "application/davmount+xml",
|
|
57085
|
+
"dbk": "application/docbook+xml",
|
|
57086
|
+
"dssc": "application/dssc+der",
|
|
57087
|
+
"xdssc": "application/dssc+xml",
|
|
57088
|
+
"es": "application/ecmascript",
|
|
57089
|
+
"ecma": "application/ecmascript",
|
|
57090
|
+
"emma": "application/emma+xml",
|
|
57091
|
+
"emotionml": "application/emotionml+xml",
|
|
57092
|
+
"epub": "application/epub+zip",
|
|
57093
|
+
"exi": "application/exi",
|
|
57094
|
+
"fdt": "application/fdt+xml",
|
|
57095
|
+
"pfr": "application/font-tdpfr",
|
|
57096
|
+
"geojson": "application/geo+json",
|
|
57097
|
+
"gml": "application/gml+xml",
|
|
57098
|
+
"gpx": "application/gpx+xml",
|
|
57099
|
+
"gxf": "application/gxf",
|
|
57100
|
+
"gz": "application/gzip",
|
|
57101
|
+
"hjson": "application/hjson",
|
|
57102
|
+
"stk": "application/hyperstudio",
|
|
57103
|
+
"ink": "application/inkml+xml",
|
|
57104
|
+
"inkml": "application/inkml+xml",
|
|
57105
|
+
"ipfix": "application/ipfix",
|
|
57106
|
+
"its": "application/its+xml",
|
|
57107
|
+
"jar": "application/java-archive",
|
|
57108
|
+
"war": "application/java-archive",
|
|
57109
|
+
"ear": "application/java-archive",
|
|
57110
|
+
"ser": "application/java-serialized-object",
|
|
57111
|
+
"class": "application/java-vm",
|
|
57112
|
+
"js": "application/javascript",
|
|
57113
|
+
"mjs": "application/javascript",
|
|
57114
|
+
"json": "application/json",
|
|
57115
|
+
"map": "application/json",
|
|
57116
|
+
"json5": "application/json5",
|
|
57117
|
+
"jsonml": "application/jsonml+json",
|
|
57118
|
+
"jsonld": "application/ld+json",
|
|
57119
|
+
"lgr": "application/lgr+xml",
|
|
57120
|
+
"lostxml": "application/lost+xml",
|
|
57121
|
+
"hqx": "application/mac-binhex40",
|
|
57122
|
+
"cpt": "application/mac-compactpro",
|
|
57123
|
+
"mads": "application/mads+xml",
|
|
57124
|
+
"webmanifest": "application/manifest+json",
|
|
57125
|
+
"mrc": "application/marc",
|
|
57126
|
+
"mrcx": "application/marcxml+xml",
|
|
57127
|
+
"ma": "application/mathematica",
|
|
57128
|
+
"nb": "application/mathematica",
|
|
57129
|
+
"mb": "application/mathematica",
|
|
57130
|
+
"mathml": "application/mathml+xml",
|
|
57131
|
+
"mbox": "application/mbox",
|
|
57132
|
+
"mscml": "application/mediaservercontrol+xml",
|
|
57133
|
+
"metalink": "application/metalink+xml",
|
|
57134
|
+
"meta4": "application/metalink4+xml",
|
|
57135
|
+
"mets": "application/mets+xml",
|
|
57136
|
+
"maei": "application/mmt-aei+xml",
|
|
57137
|
+
"musd": "application/mmt-usd+xml",
|
|
57138
|
+
"mods": "application/mods+xml",
|
|
57139
|
+
"m21": "application/mp21",
|
|
57140
|
+
"mp21": "application/mp21",
|
|
57141
|
+
"mp4s": "application/mp4",
|
|
57142
|
+
"m4p": "application/mp4",
|
|
57143
|
+
"doc": "application/msword",
|
|
57144
|
+
"dot": "application/msword",
|
|
57145
|
+
"mxf": "application/mxf",
|
|
57146
|
+
"nq": "application/n-quads",
|
|
57147
|
+
"nt": "application/n-triples",
|
|
57148
|
+
"cjs": "application/node",
|
|
57149
|
+
"bin": "application/octet-stream",
|
|
57150
|
+
"dms": "application/octet-stream",
|
|
57151
|
+
"lrf": "application/octet-stream",
|
|
57152
|
+
"mar": "application/octet-stream",
|
|
57153
|
+
"so": "application/octet-stream",
|
|
57154
|
+
"dist": "application/octet-stream",
|
|
57155
|
+
"distz": "application/octet-stream",
|
|
57156
|
+
"pkg": "application/octet-stream",
|
|
57157
|
+
"bpk": "application/octet-stream",
|
|
57158
|
+
"dump": "application/octet-stream",
|
|
57159
|
+
"elc": "application/octet-stream",
|
|
57160
|
+
"deploy": "application/octet-stream",
|
|
57161
|
+
"exe": "application/octet-stream",
|
|
57162
|
+
"dll": "application/octet-stream",
|
|
57163
|
+
"deb": "application/octet-stream",
|
|
57164
|
+
"dmg": "application/octet-stream",
|
|
57165
|
+
"iso": "application/octet-stream",
|
|
57166
|
+
"img": "application/octet-stream",
|
|
57167
|
+
"msi": "application/octet-stream",
|
|
57168
|
+
"msp": "application/octet-stream",
|
|
57169
|
+
"msm": "application/octet-stream",
|
|
57170
|
+
"buffer": "application/octet-stream",
|
|
57171
|
+
"oda": "application/oda",
|
|
57172
|
+
"opf": "application/oebps-package+xml",
|
|
57173
|
+
"ogx": "application/ogg",
|
|
57174
|
+
"omdoc": "application/omdoc+xml",
|
|
57175
|
+
"onetoc": "application/onenote",
|
|
57176
|
+
"onetoc2": "application/onenote",
|
|
57177
|
+
"onetmp": "application/onenote",
|
|
57178
|
+
"onepkg": "application/onenote",
|
|
57179
|
+
"oxps": "application/oxps",
|
|
57180
|
+
"relo": "application/p2p-overlay+xml",
|
|
57181
|
+
"xer": "application/patch-ops-error+xml",
|
|
57182
|
+
"pdf": "application/pdf",
|
|
57183
|
+
"pgp": "application/pgp-encrypted",
|
|
57184
|
+
"asc": "application/pgp-signature",
|
|
57185
|
+
"sig": "application/pgp-signature",
|
|
57186
|
+
"prf": "application/pics-rules",
|
|
57187
|
+
"p10": "application/pkcs10",
|
|
57188
|
+
"p7m": "application/pkcs7-mime",
|
|
57189
|
+
"p7c": "application/pkcs7-mime",
|
|
57190
|
+
"p7s": "application/pkcs7-signature",
|
|
57191
|
+
"p8": "application/pkcs8",
|
|
57192
|
+
"ac": "application/pkix-attr-cert",
|
|
57193
|
+
"cer": "application/pkix-cert",
|
|
57194
|
+
"crl": "application/pkix-crl",
|
|
57195
|
+
"pkipath": "application/pkix-pkipath",
|
|
57196
|
+
"pki": "application/pkixcmp",
|
|
57197
|
+
"pls": "application/pls+xml",
|
|
57198
|
+
"ai": "application/postscript",
|
|
57199
|
+
"eps": "application/postscript",
|
|
57200
|
+
"ps": "application/postscript",
|
|
57201
|
+
"provx": "application/provenance+xml",
|
|
57202
|
+
"cww": "application/prs.cww",
|
|
57203
|
+
"pskcxml": "application/pskc+xml",
|
|
57204
|
+
"raml": "application/raml+yaml",
|
|
57205
|
+
"rdf": "application/rdf+xml",
|
|
57206
|
+
"owl": "application/rdf+xml",
|
|
57207
|
+
"rif": "application/reginfo+xml",
|
|
57208
|
+
"rnc": "application/relax-ng-compact-syntax",
|
|
57209
|
+
"rl": "application/resource-lists+xml",
|
|
57210
|
+
"rld": "application/resource-lists-diff+xml",
|
|
57211
|
+
"rs": "application/rls-services+xml",
|
|
57212
|
+
"rapd": "application/route-apd+xml",
|
|
57213
|
+
"sls": "application/route-s-tsid+xml",
|
|
57214
|
+
"rusd": "application/route-usd+xml",
|
|
57215
|
+
"gbr": "application/rpki-ghostbusters",
|
|
57216
|
+
"mft": "application/rpki-manifest",
|
|
57217
|
+
"roa": "application/rpki-roa",
|
|
57218
|
+
"rsd": "application/rsd+xml",
|
|
57219
|
+
"rss": "application/rss+xml",
|
|
57220
|
+
"rtf": "application/rtf",
|
|
57221
|
+
"sbml": "application/sbml+xml",
|
|
57222
|
+
"scq": "application/scvp-cv-request",
|
|
57223
|
+
"scs": "application/scvp-cv-response",
|
|
57224
|
+
"spq": "application/scvp-vp-request",
|
|
57225
|
+
"spp": "application/scvp-vp-response",
|
|
57226
|
+
"sdp": "application/sdp",
|
|
57227
|
+
"senmlx": "application/senml+xml",
|
|
57228
|
+
"sensmlx": "application/sensml+xml",
|
|
57229
|
+
"setpay": "application/set-payment-initiation",
|
|
57230
|
+
"setreg": "application/set-registration-initiation",
|
|
57231
|
+
"shf": "application/shf+xml",
|
|
57232
|
+
"siv": "application/sieve",
|
|
57233
|
+
"sieve": "application/sieve",
|
|
57234
|
+
"smi": "application/smil+xml",
|
|
57235
|
+
"smil": "application/smil+xml",
|
|
57236
|
+
"rq": "application/sparql-query",
|
|
57237
|
+
"srx": "application/sparql-results+xml",
|
|
57238
|
+
"gram": "application/srgs",
|
|
57239
|
+
"grxml": "application/srgs+xml",
|
|
57240
|
+
"sru": "application/sru+xml",
|
|
57241
|
+
"ssdl": "application/ssdl+xml",
|
|
57242
|
+
"ssml": "application/ssml+xml",
|
|
57243
|
+
"swidtag": "application/swid+xml",
|
|
57244
|
+
"tei": "application/tei+xml",
|
|
57245
|
+
"teicorpus": "application/tei+xml",
|
|
57246
|
+
"tfi": "application/thraud+xml",
|
|
57247
|
+
"tsd": "application/timestamped-data",
|
|
57248
|
+
"toml": "application/toml",
|
|
57249
|
+
"trig": "application/trig",
|
|
57250
|
+
"ttml": "application/ttml+xml",
|
|
57251
|
+
"ubj": "application/ubjson",
|
|
57252
|
+
"rsheet": "application/urc-ressheet+xml",
|
|
57253
|
+
"td": "application/urc-targetdesc+xml",
|
|
57254
|
+
"vxml": "application/voicexml+xml",
|
|
57255
|
+
"wasm": "application/wasm",
|
|
57256
|
+
"wgt": "application/widget",
|
|
57257
|
+
"hlp": "application/winhlp",
|
|
57258
|
+
"wsdl": "application/wsdl+xml",
|
|
57259
|
+
"wspolicy": "application/wspolicy+xml",
|
|
57260
|
+
"xaml": "application/xaml+xml",
|
|
57261
|
+
"xav": "application/xcap-att+xml",
|
|
57262
|
+
"xca": "application/xcap-caps+xml",
|
|
57263
|
+
"xdf": "application/xcap-diff+xml",
|
|
57264
|
+
"xel": "application/xcap-el+xml",
|
|
57265
|
+
"xns": "application/xcap-ns+xml",
|
|
57266
|
+
"xenc": "application/xenc+xml",
|
|
57267
|
+
"xhtml": "application/xhtml+xml",
|
|
57268
|
+
"xht": "application/xhtml+xml",
|
|
57269
|
+
"xlf": "application/xliff+xml",
|
|
57270
|
+
"xml": "application/xml",
|
|
57271
|
+
"xsl": "application/xml",
|
|
57272
|
+
"xsd": "application/xml",
|
|
57273
|
+
"rng": "application/xml",
|
|
57274
|
+
"dtd": "application/xml-dtd",
|
|
57275
|
+
"xop": "application/xop+xml",
|
|
57276
|
+
"xpl": "application/xproc+xml",
|
|
57277
|
+
"xslt": "application/xml",
|
|
57278
|
+
"xspf": "application/xspf+xml",
|
|
57279
|
+
"mxml": "application/xv+xml",
|
|
57280
|
+
"xhvml": "application/xv+xml",
|
|
57281
|
+
"xvml": "application/xv+xml",
|
|
57282
|
+
"xvm": "application/xv+xml",
|
|
57283
|
+
"yang": "application/yang",
|
|
57284
|
+
"yin": "application/yin+xml",
|
|
57285
|
+
"zip": "application/zip",
|
|
57286
|
+
"3gpp": "video/3gpp",
|
|
57287
|
+
"adp": "audio/adpcm",
|
|
57288
|
+
"amr": "audio/amr",
|
|
57289
|
+
"au": "audio/basic",
|
|
57290
|
+
"snd": "audio/basic",
|
|
57291
|
+
"mid": "audio/midi",
|
|
57292
|
+
"midi": "audio/midi",
|
|
57293
|
+
"kar": "audio/midi",
|
|
57294
|
+
"rmi": "audio/midi",
|
|
57295
|
+
"mxmf": "audio/mobile-xmf",
|
|
57296
|
+
"mp3": "audio/mpeg",
|
|
57297
|
+
"m4a": "audio/mp4",
|
|
57298
|
+
"mp4a": "audio/mp4",
|
|
57299
|
+
"mpga": "audio/mpeg",
|
|
57300
|
+
"mp2": "audio/mpeg",
|
|
57301
|
+
"mp2a": "audio/mpeg",
|
|
57302
|
+
"m2a": "audio/mpeg",
|
|
57303
|
+
"m3a": "audio/mpeg",
|
|
57304
|
+
"oga": "audio/ogg",
|
|
57305
|
+
"ogg": "audio/ogg",
|
|
57306
|
+
"spx": "audio/ogg",
|
|
57307
|
+
"opus": "audio/ogg",
|
|
57308
|
+
"s3m": "audio/s3m",
|
|
57309
|
+
"sil": "audio/silk",
|
|
57310
|
+
"wav": "audio/wav",
|
|
57311
|
+
"weba": "audio/webm",
|
|
57312
|
+
"xm": "audio/xm",
|
|
57313
|
+
"ttc": "font/collection",
|
|
57314
|
+
"otf": "font/otf",
|
|
57315
|
+
"ttf": "font/ttf",
|
|
57316
|
+
"woff": "font/woff",
|
|
57317
|
+
"woff2": "font/woff2",
|
|
57318
|
+
"exr": "image/aces",
|
|
57319
|
+
"apng": "image/apng",
|
|
57320
|
+
"avif": "image/avif",
|
|
57321
|
+
"bmp": "image/bmp",
|
|
57322
|
+
"cgm": "image/cgm",
|
|
57323
|
+
"drle": "image/dicom-rle",
|
|
57324
|
+
"emf": "image/emf",
|
|
57325
|
+
"fits": "image/fits",
|
|
57326
|
+
"g3": "image/g3fax",
|
|
57327
|
+
"gif": "image/gif",
|
|
57328
|
+
"heic": "image/heic",
|
|
57329
|
+
"heics": "image/heic-sequence",
|
|
57330
|
+
"heif": "image/heif",
|
|
57331
|
+
"heifs": "image/heif-sequence",
|
|
57332
|
+
"hej2": "image/hej2k",
|
|
57333
|
+
"hsj2": "image/hsj2",
|
|
57334
|
+
"ief": "image/ief",
|
|
57335
|
+
"jls": "image/jls",
|
|
57336
|
+
"jp2": "image/jp2",
|
|
57337
|
+
"jpg2": "image/jp2",
|
|
57338
|
+
"jpeg": "image/jpeg",
|
|
57339
|
+
"jpg": "image/jpeg",
|
|
57340
|
+
"jpe": "image/jpeg",
|
|
57341
|
+
"jph": "image/jph",
|
|
57342
|
+
"jhc": "image/jphc",
|
|
57343
|
+
"jpm": "image/jpm",
|
|
57344
|
+
"jpx": "image/jpx",
|
|
57345
|
+
"jpf": "image/jpx",
|
|
57346
|
+
"jxr": "image/jxr",
|
|
57347
|
+
"jxra": "image/jxra",
|
|
57348
|
+
"jxrs": "image/jxrs",
|
|
57349
|
+
"jxs": "image/jxs",
|
|
57350
|
+
"jxsc": "image/jxsc",
|
|
57351
|
+
"jxsi": "image/jxsi",
|
|
57352
|
+
"jxss": "image/jxss",
|
|
57353
|
+
"ktx": "image/ktx",
|
|
57354
|
+
"ktx2": "image/ktx2",
|
|
57355
|
+
"png": "image/png",
|
|
57356
|
+
"btif": "image/prs.btif",
|
|
57357
|
+
"pti": "image/prs.pti",
|
|
57358
|
+
"sgi": "image/sgi",
|
|
57359
|
+
"svg": "image/svg+xml",
|
|
57360
|
+
"svgz": "image/svg+xml",
|
|
57361
|
+
"t38": "image/t38",
|
|
57362
|
+
"tif": "image/tiff",
|
|
57363
|
+
"tiff": "image/tiff",
|
|
57364
|
+
"tfx": "image/tiff-fx",
|
|
57365
|
+
"webp": "image/webp",
|
|
57366
|
+
"wmf": "image/wmf",
|
|
57367
|
+
"disposition-notification": "message/disposition-notification",
|
|
57368
|
+
"u8msg": "message/global",
|
|
57369
|
+
"u8dsn": "message/global-delivery-status",
|
|
57370
|
+
"u8mdn": "message/global-disposition-notification",
|
|
57371
|
+
"u8hdr": "message/global-headers",
|
|
57372
|
+
"eml": "message/rfc822",
|
|
57373
|
+
"mime": "message/rfc822",
|
|
57374
|
+
"3mf": "model/3mf",
|
|
57375
|
+
"gltf": "model/gltf+json",
|
|
57376
|
+
"glb": "model/gltf-binary",
|
|
57377
|
+
"igs": "model/iges",
|
|
57378
|
+
"iges": "model/iges",
|
|
57379
|
+
"msh": "model/mesh",
|
|
57380
|
+
"mesh": "model/mesh",
|
|
57381
|
+
"silo": "model/mesh",
|
|
57382
|
+
"mtl": "model/mtl",
|
|
57383
|
+
"obj": "model/obj",
|
|
57384
|
+
"stpz": "model/step+zip",
|
|
57385
|
+
"stpxz": "model/step-xml+zip",
|
|
57386
|
+
"stl": "model/stl",
|
|
57387
|
+
"wrl": "model/vrml",
|
|
57388
|
+
"vrml": "model/vrml",
|
|
57389
|
+
"x3db": "model/x3d+fastinfoset",
|
|
57390
|
+
"x3dbz": "model/x3d+binary",
|
|
57391
|
+
"x3dv": "model/x3d-vrml",
|
|
57392
|
+
"x3dvz": "model/x3d+vrml",
|
|
57393
|
+
"x3d": "model/x3d+xml",
|
|
57394
|
+
"x3dz": "model/x3d+xml",
|
|
57395
|
+
"appcache": "text/cache-manifest",
|
|
57396
|
+
"manifest": "text/cache-manifest",
|
|
57397
|
+
"ics": "text/calendar",
|
|
57398
|
+
"ifb": "text/calendar",
|
|
57399
|
+
"coffee": "text/coffeescript",
|
|
57400
|
+
"litcoffee": "text/coffeescript",
|
|
57401
|
+
"css": "text/css",
|
|
57402
|
+
"csv": "text/csv",
|
|
57403
|
+
"html": "text/html",
|
|
57404
|
+
"htm": "text/html",
|
|
57405
|
+
"shtml": "text/html",
|
|
57406
|
+
"jade": "text/jade",
|
|
57407
|
+
"jsx": "text/jsx",
|
|
57408
|
+
"less": "text/less",
|
|
57409
|
+
"markdown": "text/markdown",
|
|
57410
|
+
"md": "text/markdown",
|
|
57411
|
+
"mml": "text/mathml",
|
|
57412
|
+
"mdx": "text/mdx",
|
|
57413
|
+
"n3": "text/n3",
|
|
57414
|
+
"txt": "text/plain",
|
|
57415
|
+
"text": "text/plain",
|
|
57416
|
+
"conf": "text/plain",
|
|
57417
|
+
"def": "text/plain",
|
|
57418
|
+
"list": "text/plain",
|
|
57419
|
+
"log": "text/plain",
|
|
57420
|
+
"in": "text/plain",
|
|
57421
|
+
"ini": "text/plain",
|
|
57422
|
+
"dsc": "text/prs.lines.tag",
|
|
57423
|
+
"rtx": "text/richtext",
|
|
57424
|
+
"sgml": "text/sgml",
|
|
57425
|
+
"sgm": "text/sgml",
|
|
57426
|
+
"shex": "text/shex",
|
|
57427
|
+
"slim": "text/slim",
|
|
57428
|
+
"slm": "text/slim",
|
|
57429
|
+
"spdx": "text/spdx",
|
|
57430
|
+
"stylus": "text/stylus",
|
|
57431
|
+
"styl": "text/stylus",
|
|
57432
|
+
"tsv": "text/tab-separated-values",
|
|
57433
|
+
"t": "text/troff",
|
|
57434
|
+
"tr": "text/troff",
|
|
57435
|
+
"roff": "text/troff",
|
|
57436
|
+
"man": "text/troff",
|
|
57437
|
+
"me": "text/troff",
|
|
57438
|
+
"ms": "text/troff",
|
|
57439
|
+
"ttl": "text/turtle",
|
|
57440
|
+
"uri": "text/uri-list",
|
|
57441
|
+
"uris": "text/uri-list",
|
|
57442
|
+
"urls": "text/uri-list",
|
|
57443
|
+
"vcard": "text/vcard",
|
|
57444
|
+
"vtt": "text/vtt",
|
|
57445
|
+
"yaml": "text/yaml",
|
|
57446
|
+
"yml": "text/yaml",
|
|
57447
|
+
"3gp": "video/3gpp",
|
|
57448
|
+
"3g2": "video/3gpp2",
|
|
57449
|
+
"h261": "video/h261",
|
|
57450
|
+
"h263": "video/h263",
|
|
57451
|
+
"h264": "video/h264",
|
|
57452
|
+
"m4s": "video/iso.segment",
|
|
57453
|
+
"jpgv": "video/jpeg",
|
|
57454
|
+
"jpgm": "image/jpm",
|
|
57455
|
+
"mj2": "video/mj2",
|
|
57456
|
+
"mjp2": "video/mj2",
|
|
57457
|
+
"ts": "video/mp2t",
|
|
57458
|
+
"mp4": "video/mp4",
|
|
57459
|
+
"mp4v": "video/mp4",
|
|
57460
|
+
"mpg4": "video/mp4",
|
|
57461
|
+
"mpeg": "video/mpeg",
|
|
57462
|
+
"mpg": "video/mpeg",
|
|
57463
|
+
"mpe": "video/mpeg",
|
|
57464
|
+
"m1v": "video/mpeg",
|
|
57465
|
+
"m2v": "video/mpeg",
|
|
57466
|
+
"ogv": "video/ogg",
|
|
57467
|
+
"qt": "video/quicktime",
|
|
57468
|
+
"mov": "video/quicktime",
|
|
57469
|
+
"webm": "video/webm"
|
|
57470
|
+
};
|
|
57471
|
+
|
|
57472
|
+
function lookup(extn) {
|
|
57473
|
+
let tmp = ('' + extn).trim().toLowerCase();
|
|
57474
|
+
let idx = tmp.lastIndexOf('.');
|
|
57475
|
+
return mimes[!~idx ? tmp : tmp.substring(++idx)];
|
|
56957
57476
|
}
|
|
56958
57477
|
|
|
56959
|
-
/**
|
|
56960
|
-
* Define mimetype -> extension mappings. Each key is a mime-type that maps
|
|
56961
|
-
* to an array of extensions associated with the type. The first extension is
|
|
56962
|
-
* used as the default extension for the type.
|
|
56963
|
-
*
|
|
56964
|
-
* e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']});
|
|
56965
|
-
*
|
|
56966
|
-
* If a type declares an extension that has already been defined, an error will
|
|
56967
|
-
* be thrown. To suppress this error and force the extension to be associated
|
|
56968
|
-
* with the new type, pass `force`=true. Alternatively, you may prefix the
|
|
56969
|
-
* extension with "*" to map the type to extension, without mapping the
|
|
56970
|
-
* extension to the type.
|
|
56971
|
-
*
|
|
56972
|
-
* e.g. mime.define({'audio/wav', ['wav']}, {'audio/x-wav', ['*wav']});
|
|
56973
|
-
*
|
|
56974
|
-
*
|
|
56975
|
-
* @param map (Object) type definitions
|
|
56976
|
-
* @param force (Boolean) if true, force overriding of existing definitions
|
|
56977
|
-
*/
|
|
56978
|
-
Mime$1.prototype.define = function(typeMap, force) {
|
|
56979
|
-
for (let type in typeMap) {
|
|
56980
|
-
let extensions = typeMap[type].map(function(t) {
|
|
56981
|
-
return t.toLowerCase();
|
|
56982
|
-
});
|
|
56983
|
-
type = type.toLowerCase();
|
|
56984
|
-
|
|
56985
|
-
for (let i = 0; i < extensions.length; i++) {
|
|
56986
|
-
const ext = extensions[i];
|
|
56987
|
-
|
|
56988
|
-
// '*' prefix = not the preferred type for this extension. So fixup the
|
|
56989
|
-
// extension, and skip it.
|
|
56990
|
-
if (ext[0] === '*') {
|
|
56991
|
-
continue;
|
|
56992
|
-
}
|
|
56993
|
-
|
|
56994
|
-
if (!force && (ext in this._types)) {
|
|
56995
|
-
throw new Error(
|
|
56996
|
-
'Attempt to change mapping for "' + ext +
|
|
56997
|
-
'" extension from "' + this._types[ext] + '" to "' + type +
|
|
56998
|
-
'". Pass `force=true` to allow this, otherwise remove "' + ext +
|
|
56999
|
-
'" from the list of extensions for "' + type + '".'
|
|
57000
|
-
);
|
|
57001
|
-
}
|
|
57002
|
-
|
|
57003
|
-
this._types[ext] = type;
|
|
57004
|
-
}
|
|
57005
|
-
|
|
57006
|
-
// Use first extension as default
|
|
57007
|
-
if (force || !this._extensions[type]) {
|
|
57008
|
-
const ext = extensions[0];
|
|
57009
|
-
this._extensions[type] = (ext[0] !== '*') ? ext : ext.substr(1);
|
|
57010
|
-
}
|
|
57011
|
-
}
|
|
57012
|
-
};
|
|
57013
|
-
|
|
57014
|
-
/**
|
|
57015
|
-
* Lookup a mime type based on extension
|
|
57016
|
-
*/
|
|
57017
|
-
Mime$1.prototype.getType = function(path) {
|
|
57018
|
-
path = String(path);
|
|
57019
|
-
let last = path.replace(/^.*[/\\]/, '').toLowerCase();
|
|
57020
|
-
let ext = last.replace(/^.*\./, '').toLowerCase();
|
|
57021
|
-
|
|
57022
|
-
let hasPath = last.length < path.length;
|
|
57023
|
-
let hasDot = ext.length < last.length - 1;
|
|
57024
|
-
|
|
57025
|
-
return (hasDot || !hasPath) && this._types[ext] || null;
|
|
57026
|
-
};
|
|
57027
|
-
|
|
57028
|
-
/**
|
|
57029
|
-
* Return file extension associated with a mime type
|
|
57030
|
-
*/
|
|
57031
|
-
Mime$1.prototype.getExtension = function(type) {
|
|
57032
|
-
type = /^\s*([^;\s]*)/.test(type) && RegExp.$1;
|
|
57033
|
-
return type && this._extensions[type.toLowerCase()] || null;
|
|
57034
|
-
};
|
|
57035
|
-
|
|
57036
|
-
var Mime_1 = Mime$1;
|
|
57037
|
-
|
|
57038
|
-
var standard = {"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};
|
|
57039
|
-
|
|
57040
|
-
let Mime = Mime_1;
|
|
57041
|
-
var lite = new Mime(standard);
|
|
57042
|
-
|
|
57043
57478
|
const noop$1 = () => {};
|
|
57044
57479
|
|
|
57045
57480
|
function isMatch(uri, arr) {
|
|
@@ -57132,7 +57567,7 @@ const ENCODING = {
|
|
|
57132
57567
|
function toHeaders(name, stats, isEtag) {
|
|
57133
57568
|
let enc = ENCODING[name.slice(-3)];
|
|
57134
57569
|
|
|
57135
|
-
let ctype =
|
|
57570
|
+
let ctype = lookup(name.slice(0, enc && -3)) || '';
|
|
57136
57571
|
if (ctype === 'text/html') ctype += ';charset=utf-8';
|
|
57137
57572
|
|
|
57138
57573
|
let headers = {
|
|
@@ -57543,21 +57978,26 @@ function transformMiddleware(server) {
|
|
|
57543
57978
|
// always allow vite client requests so that it can trigger page reload
|
|
57544
57979
|
!((_a = req.url) === null || _a === void 0 ? void 0 : _a.startsWith(CLIENT_PUBLIC_PATH)) &&
|
|
57545
57980
|
!((_b = req.url) === null || _b === void 0 ? void 0 : _b.includes('vite/dist/client'))) {
|
|
57546
|
-
|
|
57547
|
-
|
|
57548
|
-
|
|
57549
|
-
|
|
57550
|
-
|
|
57551
|
-
|
|
57981
|
+
try {
|
|
57982
|
+
// missing dep pending reload, hold request until reload happens
|
|
57983
|
+
await Promise.race([
|
|
57984
|
+
server._pendingReload,
|
|
57985
|
+
// If the refresh has not happened after timeout, Vite considers
|
|
57986
|
+
// something unexpected has happened. In this case, Vite
|
|
57987
|
+
// returns an empty response that will error.
|
|
57988
|
+
new Promise((_, reject) => setTimeout(reject, NEW_DEPENDENCY_BUILD_TIMEOUT))
|
|
57989
|
+
]);
|
|
57990
|
+
}
|
|
57991
|
+
catch {
|
|
57552
57992
|
// Don't do anything if response has already been sent
|
|
57553
|
-
if (res.writableEnded)
|
|
57554
|
-
|
|
57555
|
-
|
|
57556
|
-
|
|
57557
|
-
|
|
57558
|
-
|
|
57559
|
-
|
|
57560
|
-
|
|
57993
|
+
if (!res.writableEnded) {
|
|
57994
|
+
// status code request timeout
|
|
57995
|
+
res.statusCode = 408;
|
|
57996
|
+
res.end(`<h1>[vite] Something unexpected happened while optimizing "${req.url}"<h1>` +
|
|
57997
|
+
`<p>The current page should have reloaded by now</p>`);
|
|
57998
|
+
}
|
|
57999
|
+
return;
|
|
58000
|
+
}
|
|
57561
58001
|
}
|
|
57562
58002
|
let url = decodeURI(removeTimestampQuery(req.url)).replace(NULL_BYTE_PLACEHOLDER, '\0');
|
|
57563
58003
|
const withoutQuery = cleanUrl(url);
|
|
@@ -57957,7 +58397,12 @@ async function handleHMRUpdate(file, server) {
|
|
|
57957
58397
|
// auto restart server
|
|
57958
58398
|
debugHmr(`[config change] ${source.dim(shortFile)}`);
|
|
57959
58399
|
config.logger.info(source.green(`${path__default.relative(process.cwd(), file)} changed, restarting server...`), { clear: true, timestamp: true });
|
|
57960
|
-
|
|
58400
|
+
try {
|
|
58401
|
+
await server.restart();
|
|
58402
|
+
}
|
|
58403
|
+
catch (e) {
|
|
58404
|
+
config.logger.error(source.red(e));
|
|
58405
|
+
}
|
|
57961
58406
|
return;
|
|
57962
58407
|
}
|
|
57963
58408
|
debugHmr(`[file change] ${source.dim(shortFile)}`);
|
|
@@ -67893,7 +68338,7 @@ function resolveServerOptions(root, raw) {
|
|
|
67893
68338
|
async function restartServer(server) {
|
|
67894
68339
|
// @ts-ignore
|
|
67895
68340
|
global.__vite_start_time = perf_hooks.performance.now();
|
|
67896
|
-
const { port } = server.config.server;
|
|
68341
|
+
const { port: prevPort, host: prevHost } = server.config.server;
|
|
67897
68342
|
await server.close();
|
|
67898
68343
|
let newServer = null;
|
|
67899
68344
|
try {
|
|
@@ -67911,11 +68356,17 @@ async function restartServer(server) {
|
|
|
67911
68356
|
server[key] = newServer[key];
|
|
67912
68357
|
}
|
|
67913
68358
|
}
|
|
67914
|
-
|
|
68359
|
+
const { logger, server: { port, host, middlewareMode } } = server.config;
|
|
68360
|
+
if (!middlewareMode) {
|
|
67915
68361
|
await server.listen(port, true);
|
|
68362
|
+
logger.info('server restarted.', { timestamp: true });
|
|
68363
|
+
if (port !== prevPort || host !== prevHost) {
|
|
68364
|
+
logger.info('');
|
|
68365
|
+
server.printUrls();
|
|
68366
|
+
}
|
|
67916
68367
|
}
|
|
67917
68368
|
else {
|
|
67918
|
-
|
|
68369
|
+
logger.info('server restarted.', { timestamp: true });
|
|
67919
68370
|
}
|
|
67920
68371
|
}
|
|
67921
68372
|
|
|
@@ -81932,7 +82383,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development')
|
|
|
81932
82383
|
}
|
|
81933
82384
|
// resolve public base url
|
|
81934
82385
|
const BASE_URL = resolveBaseUrl(config.base, command === 'build', logger);
|
|
81935
|
-
const resolvedBuildOptions = resolveBuildOptions(resolvedRoot, config.build);
|
|
82386
|
+
const resolvedBuildOptions = resolveBuildOptions(resolvedRoot, config.build, command === 'build');
|
|
81936
82387
|
// resolve cache directory
|
|
81937
82388
|
const pkgPath = lookupFile(resolvedRoot, [`package.json`], true /* pathOnly */);
|
|
81938
82389
|
const cacheDir = config.cacheDir
|
|
@@ -82136,10 +82587,10 @@ function resolveBaseUrl(base = '/', isBuild, logger) {
|
|
|
82136
82587
|
}
|
|
82137
82588
|
return base;
|
|
82138
82589
|
}
|
|
82139
|
-
function mergeConfigRecursively(
|
|
82140
|
-
const merged = { ...
|
|
82141
|
-
for (const key in
|
|
82142
|
-
const value =
|
|
82590
|
+
function mergeConfigRecursively(defaults, overrides, rootPath) {
|
|
82591
|
+
const merged = { ...defaults };
|
|
82592
|
+
for (const key in overrides) {
|
|
82593
|
+
const value = overrides[key];
|
|
82143
82594
|
if (value == null) {
|
|
82144
82595
|
continue;
|
|
82145
82596
|
}
|
|
@@ -82170,8 +82621,8 @@ function mergeConfigRecursively(a, b, rootPath) {
|
|
|
82170
82621
|
}
|
|
82171
82622
|
return merged;
|
|
82172
82623
|
}
|
|
82173
|
-
function mergeConfig(
|
|
82174
|
-
return mergeConfigRecursively(
|
|
82624
|
+
function mergeConfig(defaults, overrides, isRoot = true) {
|
|
82625
|
+
return mergeConfigRecursively(defaults, overrides, isRoot ? '' : '.');
|
|
82175
82626
|
}
|
|
82176
82627
|
function mergeAlias(a = [], b = []) {
|
|
82177
82628
|
return [...normalizeAlias(a), ...normalizeAlias(b)];
|
|
@@ -82457,4 +82908,4 @@ exports.send = send$1;
|
|
|
82457
82908
|
exports.sortUserPlugins = sortUserPlugins;
|
|
82458
82909
|
exports.source = source;
|
|
82459
82910
|
exports.transformWithEsbuild = transformWithEsbuild;
|
|
82460
|
-
//# sourceMappingURL=dep-
|
|
82911
|
+
//# sourceMappingURL=dep-cb6d7f22.js.map
|