@sveltejs/kit 1.0.0-next.201 → 1.0.0-next.205

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.
@@ -10,12 +10,91 @@ import 'child_process';
10
10
  import 'net';
11
11
  import 'os';
12
12
  import './error.js';
13
- import 'http';
14
- import 'https';
15
- import 'zlib';
16
- import 'stream';
17
- import 'util';
18
- import 'crypto';
13
+ import 'node:http';
14
+ import 'node:https';
15
+ import 'node:zlib';
16
+ import 'node:stream';
17
+ import 'node:util';
18
+ import 'node:url';
19
+
20
+ /** @typedef {{
21
+ * fn: () => Promise<any>,
22
+ * fulfil: (value: any) => void,
23
+ * reject: (error: Error) => void
24
+ * }} Task */
25
+
26
+ /** @param {number} concurrency */
27
+ function queue(concurrency) {
28
+ /** @type {Task[]} */
29
+ const tasks = [];
30
+
31
+ let current = 0;
32
+
33
+ /** @type {(value?: any) => void} */
34
+ let fulfil;
35
+
36
+ /** @type {(error: Error) => void} */
37
+ let reject;
38
+
39
+ let closed = false;
40
+
41
+ const done = new Promise((f, r) => {
42
+ fulfil = f;
43
+ reject = r;
44
+ });
45
+
46
+ done.catch(() => {
47
+ // this is necessary in case a catch handler is never added
48
+ // to the done promise by the user
49
+ });
50
+
51
+ function dequeue() {
52
+ if (current < concurrency) {
53
+ const task = tasks.shift();
54
+
55
+ if (task) {
56
+ current += 1;
57
+ const promise = Promise.resolve(task.fn());
58
+
59
+ promise
60
+ .then(task.fulfil, (err) => {
61
+ task.reject(err);
62
+ reject(err);
63
+ })
64
+ .then(() => {
65
+ current -= 1;
66
+ dequeue();
67
+ });
68
+ } else if (current === 0) {
69
+ closed = true;
70
+ fulfil();
71
+ }
72
+ }
73
+ }
74
+
75
+ return {
76
+ /** @param {() => any} fn */
77
+ add: (fn) => {
78
+ if (closed) throw new Error('Cannot add tasks to a queue that has ended');
79
+
80
+ const promise = new Promise((fulfil, reject) => {
81
+ tasks.push({ fn, fulfil, reject });
82
+ });
83
+
84
+ dequeue();
85
+ return promise;
86
+ },
87
+
88
+ done: () => {
89
+ if (current === 0) {
90
+ closed = true;
91
+ fulfil();
92
+ }
93
+
94
+ return done;
95
+ }
96
+ };
97
+ }
19
98
 
20
99
  /**
21
100
  * @typedef {import('types/config').PrerenderErrorHandler} PrerenderErrorHandler
@@ -151,16 +230,27 @@ async function prerender({ cwd, out, log, config, build_data, fallback, all }) {
151
230
  return path;
152
231
  }
153
232
 
233
+ const q = queue(config.kit.prerender.concurrency);
234
+
154
235
  /**
155
236
  * @param {string} decoded_path
156
237
  * @param {string?} referrer
157
238
  */
158
- async function visit(decoded_path, referrer) {
239
+ function enqueue(decoded_path, referrer) {
159
240
  const path = encodeURI(normalize(decoded_path));
160
241
 
161
242
  if (seen.has(path)) return;
162
243
  seen.add(path);
163
244
 
245
+ return q.add(() => visit(path, decoded_path, referrer));
246
+ }
247
+
248
+ /**
249
+ * @param {string} path
250
+ * @param {string} decoded_path
251
+ * @param {string?} referrer
252
+ */
253
+ async function visit(path, decoded_path, referrer) {
164
254
  /** @type {Map<string, import('types/hooks').ServerResponse>} */
165
255
  const dependencies = new Map();
166
256
 
@@ -205,7 +295,7 @@ async function prerender({ cwd, out, log, config, build_data, fallback, all }) {
205
295
 
206
296
  const resolved = resolve$1(path, location);
207
297
  if (is_root_relative(resolved)) {
208
- await visit(resolved, path);
298
+ enqueue(resolved, path);
209
299
  }
210
300
  } else {
211
301
  log.warn(`location header missing on redirect received from ${decoded_path}`);
@@ -290,7 +380,7 @@ async function prerender({ cwd, out, log, config, build_data, fallback, all }) {
290
380
 
291
381
  if (parsed.search) ;
292
382
 
293
- await visit(pathname, path);
383
+ enqueue(pathname, path);
294
384
  }
295
385
  }
296
386
  }
@@ -300,12 +390,14 @@ async function prerender({ cwd, out, log, config, build_data, fallback, all }) {
300
390
  for (const entry of config.kit.prerender.entries) {
301
391
  if (entry === '*') {
302
392
  for (const entry of build_data.entries) {
303
- await visit(entry, null);
393
+ enqueue(entry, null);
304
394
  }
305
395
  } else {
306
- await visit(entry, null);
396
+ enqueue(entry, null);
307
397
  }
308
398
  }
399
+
400
+ await q.done();
309
401
  }
310
402
 
311
403
  if (fallback) {
@@ -1,18 +1,20 @@
1
1
  import * as fs from 'fs';
2
2
  import fs__default, { readdirSync, statSync } from 'fs';
3
- import http from 'http';
4
- import https from 'https';
3
+ import require$$2 from 'http';
4
+ import require$$3 from 'https';
5
5
  import { resolve, join, normalize } from 'path';
6
6
  import * as require$$7 from 'querystring';
7
- import { s as standard, M as Mime_1 } from './standard.js';
8
7
  import { pathToFileURL } from 'url';
9
8
  import { getRawBody } from '../node.js';
10
9
  import { __fetch_polyfill } from '../install-fetch.js';
11
10
  import { S as SVELTE_KIT, a as SVELTE_KIT_ASSETS } from './constants.js';
12
- import 'zlib';
13
- import 'stream';
14
- import 'util';
15
- import 'crypto';
11
+ import 'node:http';
12
+ import 'node:https';
13
+ import 'node:zlib';
14
+ import 'node:stream';
15
+ import 'node:util';
16
+ import 'node:url';
17
+ import 'net';
16
18
 
17
19
  /**
18
20
  * @typedef ParsedURL
@@ -66,8 +68,420 @@ function list(dir, callback, pre='') {
66
68
  }
67
69
  }
68
70
 
69
- let Mime = Mime_1;
70
- var lite = new Mime(standard);
71
+ const mimes = {
72
+ "ez": "application/andrew-inset",
73
+ "aw": "application/applixware",
74
+ "atom": "application/atom+xml",
75
+ "atomcat": "application/atomcat+xml",
76
+ "atomdeleted": "application/atomdeleted+xml",
77
+ "atomsvc": "application/atomsvc+xml",
78
+ "dwd": "application/atsc-dwd+xml",
79
+ "held": "application/atsc-held+xml",
80
+ "rsat": "application/atsc-rsat+xml",
81
+ "bdoc": "application/bdoc",
82
+ "xcs": "application/calendar+xml",
83
+ "ccxml": "application/ccxml+xml",
84
+ "cdfx": "application/cdfx+xml",
85
+ "cdmia": "application/cdmi-capability",
86
+ "cdmic": "application/cdmi-container",
87
+ "cdmid": "application/cdmi-domain",
88
+ "cdmio": "application/cdmi-object",
89
+ "cdmiq": "application/cdmi-queue",
90
+ "cu": "application/cu-seeme",
91
+ "mpd": "application/dash+xml",
92
+ "davmount": "application/davmount+xml",
93
+ "dbk": "application/docbook+xml",
94
+ "dssc": "application/dssc+der",
95
+ "xdssc": "application/dssc+xml",
96
+ "es": "application/ecmascript",
97
+ "ecma": "application/ecmascript",
98
+ "emma": "application/emma+xml",
99
+ "emotionml": "application/emotionml+xml",
100
+ "epub": "application/epub+zip",
101
+ "exi": "application/exi",
102
+ "fdt": "application/fdt+xml",
103
+ "pfr": "application/font-tdpfr",
104
+ "geojson": "application/geo+json",
105
+ "gml": "application/gml+xml",
106
+ "gpx": "application/gpx+xml",
107
+ "gxf": "application/gxf",
108
+ "gz": "application/gzip",
109
+ "hjson": "application/hjson",
110
+ "stk": "application/hyperstudio",
111
+ "ink": "application/inkml+xml",
112
+ "inkml": "application/inkml+xml",
113
+ "ipfix": "application/ipfix",
114
+ "its": "application/its+xml",
115
+ "jar": "application/java-archive",
116
+ "war": "application/java-archive",
117
+ "ear": "application/java-archive",
118
+ "ser": "application/java-serialized-object",
119
+ "class": "application/java-vm",
120
+ "js": "application/javascript",
121
+ "mjs": "application/javascript",
122
+ "json": "application/json",
123
+ "map": "application/json",
124
+ "json5": "application/json5",
125
+ "jsonml": "application/jsonml+json",
126
+ "jsonld": "application/ld+json",
127
+ "lgr": "application/lgr+xml",
128
+ "lostxml": "application/lost+xml",
129
+ "hqx": "application/mac-binhex40",
130
+ "cpt": "application/mac-compactpro",
131
+ "mads": "application/mads+xml",
132
+ "webmanifest": "application/manifest+json",
133
+ "mrc": "application/marc",
134
+ "mrcx": "application/marcxml+xml",
135
+ "ma": "application/mathematica",
136
+ "nb": "application/mathematica",
137
+ "mb": "application/mathematica",
138
+ "mathml": "application/mathml+xml",
139
+ "mbox": "application/mbox",
140
+ "mscml": "application/mediaservercontrol+xml",
141
+ "metalink": "application/metalink+xml",
142
+ "meta4": "application/metalink4+xml",
143
+ "mets": "application/mets+xml",
144
+ "maei": "application/mmt-aei+xml",
145
+ "musd": "application/mmt-usd+xml",
146
+ "mods": "application/mods+xml",
147
+ "m21": "application/mp21",
148
+ "mp21": "application/mp21",
149
+ "mp4s": "application/mp4",
150
+ "m4p": "application/mp4",
151
+ "doc": "application/msword",
152
+ "dot": "application/msword",
153
+ "mxf": "application/mxf",
154
+ "nq": "application/n-quads",
155
+ "nt": "application/n-triples",
156
+ "cjs": "application/node",
157
+ "bin": "application/octet-stream",
158
+ "dms": "application/octet-stream",
159
+ "lrf": "application/octet-stream",
160
+ "mar": "application/octet-stream",
161
+ "so": "application/octet-stream",
162
+ "dist": "application/octet-stream",
163
+ "distz": "application/octet-stream",
164
+ "pkg": "application/octet-stream",
165
+ "bpk": "application/octet-stream",
166
+ "dump": "application/octet-stream",
167
+ "elc": "application/octet-stream",
168
+ "deploy": "application/octet-stream",
169
+ "exe": "application/octet-stream",
170
+ "dll": "application/octet-stream",
171
+ "deb": "application/octet-stream",
172
+ "dmg": "application/octet-stream",
173
+ "iso": "application/octet-stream",
174
+ "img": "application/octet-stream",
175
+ "msi": "application/octet-stream",
176
+ "msp": "application/octet-stream",
177
+ "msm": "application/octet-stream",
178
+ "buffer": "application/octet-stream",
179
+ "oda": "application/oda",
180
+ "opf": "application/oebps-package+xml",
181
+ "ogx": "application/ogg",
182
+ "omdoc": "application/omdoc+xml",
183
+ "onetoc": "application/onenote",
184
+ "onetoc2": "application/onenote",
185
+ "onetmp": "application/onenote",
186
+ "onepkg": "application/onenote",
187
+ "oxps": "application/oxps",
188
+ "relo": "application/p2p-overlay+xml",
189
+ "xer": "application/patch-ops-error+xml",
190
+ "pdf": "application/pdf",
191
+ "pgp": "application/pgp-encrypted",
192
+ "asc": "application/pgp-signature",
193
+ "sig": "application/pgp-signature",
194
+ "prf": "application/pics-rules",
195
+ "p10": "application/pkcs10",
196
+ "p7m": "application/pkcs7-mime",
197
+ "p7c": "application/pkcs7-mime",
198
+ "p7s": "application/pkcs7-signature",
199
+ "p8": "application/pkcs8",
200
+ "ac": "application/pkix-attr-cert",
201
+ "cer": "application/pkix-cert",
202
+ "crl": "application/pkix-crl",
203
+ "pkipath": "application/pkix-pkipath",
204
+ "pki": "application/pkixcmp",
205
+ "pls": "application/pls+xml",
206
+ "ai": "application/postscript",
207
+ "eps": "application/postscript",
208
+ "ps": "application/postscript",
209
+ "provx": "application/provenance+xml",
210
+ "cww": "application/prs.cww",
211
+ "pskcxml": "application/pskc+xml",
212
+ "raml": "application/raml+yaml",
213
+ "rdf": "application/rdf+xml",
214
+ "owl": "application/rdf+xml",
215
+ "rif": "application/reginfo+xml",
216
+ "rnc": "application/relax-ng-compact-syntax",
217
+ "rl": "application/resource-lists+xml",
218
+ "rld": "application/resource-lists-diff+xml",
219
+ "rs": "application/rls-services+xml",
220
+ "rapd": "application/route-apd+xml",
221
+ "sls": "application/route-s-tsid+xml",
222
+ "rusd": "application/route-usd+xml",
223
+ "gbr": "application/rpki-ghostbusters",
224
+ "mft": "application/rpki-manifest",
225
+ "roa": "application/rpki-roa",
226
+ "rsd": "application/rsd+xml",
227
+ "rss": "application/rss+xml",
228
+ "rtf": "application/rtf",
229
+ "sbml": "application/sbml+xml",
230
+ "scq": "application/scvp-cv-request",
231
+ "scs": "application/scvp-cv-response",
232
+ "spq": "application/scvp-vp-request",
233
+ "spp": "application/scvp-vp-response",
234
+ "sdp": "application/sdp",
235
+ "senmlx": "application/senml+xml",
236
+ "sensmlx": "application/sensml+xml",
237
+ "setpay": "application/set-payment-initiation",
238
+ "setreg": "application/set-registration-initiation",
239
+ "shf": "application/shf+xml",
240
+ "siv": "application/sieve",
241
+ "sieve": "application/sieve",
242
+ "smi": "application/smil+xml",
243
+ "smil": "application/smil+xml",
244
+ "rq": "application/sparql-query",
245
+ "srx": "application/sparql-results+xml",
246
+ "gram": "application/srgs",
247
+ "grxml": "application/srgs+xml",
248
+ "sru": "application/sru+xml",
249
+ "ssdl": "application/ssdl+xml",
250
+ "ssml": "application/ssml+xml",
251
+ "swidtag": "application/swid+xml",
252
+ "tei": "application/tei+xml",
253
+ "teicorpus": "application/tei+xml",
254
+ "tfi": "application/thraud+xml",
255
+ "tsd": "application/timestamped-data",
256
+ "toml": "application/toml",
257
+ "trig": "application/trig",
258
+ "ttml": "application/ttml+xml",
259
+ "ubj": "application/ubjson",
260
+ "rsheet": "application/urc-ressheet+xml",
261
+ "td": "application/urc-targetdesc+xml",
262
+ "vxml": "application/voicexml+xml",
263
+ "wasm": "application/wasm",
264
+ "wgt": "application/widget",
265
+ "hlp": "application/winhlp",
266
+ "wsdl": "application/wsdl+xml",
267
+ "wspolicy": "application/wspolicy+xml",
268
+ "xaml": "application/xaml+xml",
269
+ "xav": "application/xcap-att+xml",
270
+ "xca": "application/xcap-caps+xml",
271
+ "xdf": "application/xcap-diff+xml",
272
+ "xel": "application/xcap-el+xml",
273
+ "xns": "application/xcap-ns+xml",
274
+ "xenc": "application/xenc+xml",
275
+ "xhtml": "application/xhtml+xml",
276
+ "xht": "application/xhtml+xml",
277
+ "xlf": "application/xliff+xml",
278
+ "xml": "application/xml",
279
+ "xsl": "application/xml",
280
+ "xsd": "application/xml",
281
+ "rng": "application/xml",
282
+ "dtd": "application/xml-dtd",
283
+ "xop": "application/xop+xml",
284
+ "xpl": "application/xproc+xml",
285
+ "xslt": "application/xml",
286
+ "xspf": "application/xspf+xml",
287
+ "mxml": "application/xv+xml",
288
+ "xhvml": "application/xv+xml",
289
+ "xvml": "application/xv+xml",
290
+ "xvm": "application/xv+xml",
291
+ "yang": "application/yang",
292
+ "yin": "application/yin+xml",
293
+ "zip": "application/zip",
294
+ "3gpp": "video/3gpp",
295
+ "adp": "audio/adpcm",
296
+ "amr": "audio/amr",
297
+ "au": "audio/basic",
298
+ "snd": "audio/basic",
299
+ "mid": "audio/midi",
300
+ "midi": "audio/midi",
301
+ "kar": "audio/midi",
302
+ "rmi": "audio/midi",
303
+ "mxmf": "audio/mobile-xmf",
304
+ "mp3": "audio/mpeg",
305
+ "m4a": "audio/mp4",
306
+ "mp4a": "audio/mp4",
307
+ "mpga": "audio/mpeg",
308
+ "mp2": "audio/mpeg",
309
+ "mp2a": "audio/mpeg",
310
+ "m2a": "audio/mpeg",
311
+ "m3a": "audio/mpeg",
312
+ "oga": "audio/ogg",
313
+ "ogg": "audio/ogg",
314
+ "spx": "audio/ogg",
315
+ "opus": "audio/ogg",
316
+ "s3m": "audio/s3m",
317
+ "sil": "audio/silk",
318
+ "wav": "audio/wav",
319
+ "weba": "audio/webm",
320
+ "xm": "audio/xm",
321
+ "ttc": "font/collection",
322
+ "otf": "font/otf",
323
+ "ttf": "font/ttf",
324
+ "woff": "font/woff",
325
+ "woff2": "font/woff2",
326
+ "exr": "image/aces",
327
+ "apng": "image/apng",
328
+ "avif": "image/avif",
329
+ "bmp": "image/bmp",
330
+ "cgm": "image/cgm",
331
+ "drle": "image/dicom-rle",
332
+ "emf": "image/emf",
333
+ "fits": "image/fits",
334
+ "g3": "image/g3fax",
335
+ "gif": "image/gif",
336
+ "heic": "image/heic",
337
+ "heics": "image/heic-sequence",
338
+ "heif": "image/heif",
339
+ "heifs": "image/heif-sequence",
340
+ "hej2": "image/hej2k",
341
+ "hsj2": "image/hsj2",
342
+ "ief": "image/ief",
343
+ "jls": "image/jls",
344
+ "jp2": "image/jp2",
345
+ "jpg2": "image/jp2",
346
+ "jpeg": "image/jpeg",
347
+ "jpg": "image/jpeg",
348
+ "jpe": "image/jpeg",
349
+ "jph": "image/jph",
350
+ "jhc": "image/jphc",
351
+ "jpm": "image/jpm",
352
+ "jpx": "image/jpx",
353
+ "jpf": "image/jpx",
354
+ "jxr": "image/jxr",
355
+ "jxra": "image/jxra",
356
+ "jxrs": "image/jxrs",
357
+ "jxs": "image/jxs",
358
+ "jxsc": "image/jxsc",
359
+ "jxsi": "image/jxsi",
360
+ "jxss": "image/jxss",
361
+ "ktx": "image/ktx",
362
+ "ktx2": "image/ktx2",
363
+ "png": "image/png",
364
+ "btif": "image/prs.btif",
365
+ "pti": "image/prs.pti",
366
+ "sgi": "image/sgi",
367
+ "svg": "image/svg+xml",
368
+ "svgz": "image/svg+xml",
369
+ "t38": "image/t38",
370
+ "tif": "image/tiff",
371
+ "tiff": "image/tiff",
372
+ "tfx": "image/tiff-fx",
373
+ "webp": "image/webp",
374
+ "wmf": "image/wmf",
375
+ "disposition-notification": "message/disposition-notification",
376
+ "u8msg": "message/global",
377
+ "u8dsn": "message/global-delivery-status",
378
+ "u8mdn": "message/global-disposition-notification",
379
+ "u8hdr": "message/global-headers",
380
+ "eml": "message/rfc822",
381
+ "mime": "message/rfc822",
382
+ "3mf": "model/3mf",
383
+ "gltf": "model/gltf+json",
384
+ "glb": "model/gltf-binary",
385
+ "igs": "model/iges",
386
+ "iges": "model/iges",
387
+ "msh": "model/mesh",
388
+ "mesh": "model/mesh",
389
+ "silo": "model/mesh",
390
+ "mtl": "model/mtl",
391
+ "obj": "model/obj",
392
+ "stpz": "model/step+zip",
393
+ "stpxz": "model/step-xml+zip",
394
+ "stl": "model/stl",
395
+ "wrl": "model/vrml",
396
+ "vrml": "model/vrml",
397
+ "x3db": "model/x3d+fastinfoset",
398
+ "x3dbz": "model/x3d+binary",
399
+ "x3dv": "model/x3d-vrml",
400
+ "x3dvz": "model/x3d+vrml",
401
+ "x3d": "model/x3d+xml",
402
+ "x3dz": "model/x3d+xml",
403
+ "appcache": "text/cache-manifest",
404
+ "manifest": "text/cache-manifest",
405
+ "ics": "text/calendar",
406
+ "ifb": "text/calendar",
407
+ "coffee": "text/coffeescript",
408
+ "litcoffee": "text/coffeescript",
409
+ "css": "text/css",
410
+ "csv": "text/csv",
411
+ "html": "text/html",
412
+ "htm": "text/html",
413
+ "shtml": "text/html",
414
+ "jade": "text/jade",
415
+ "jsx": "text/jsx",
416
+ "less": "text/less",
417
+ "markdown": "text/markdown",
418
+ "md": "text/markdown",
419
+ "mml": "text/mathml",
420
+ "mdx": "text/mdx",
421
+ "n3": "text/n3",
422
+ "txt": "text/plain",
423
+ "text": "text/plain",
424
+ "conf": "text/plain",
425
+ "def": "text/plain",
426
+ "list": "text/plain",
427
+ "log": "text/plain",
428
+ "in": "text/plain",
429
+ "ini": "text/plain",
430
+ "dsc": "text/prs.lines.tag",
431
+ "rtx": "text/richtext",
432
+ "sgml": "text/sgml",
433
+ "sgm": "text/sgml",
434
+ "shex": "text/shex",
435
+ "slim": "text/slim",
436
+ "slm": "text/slim",
437
+ "spdx": "text/spdx",
438
+ "stylus": "text/stylus",
439
+ "styl": "text/stylus",
440
+ "tsv": "text/tab-separated-values",
441
+ "t": "text/troff",
442
+ "tr": "text/troff",
443
+ "roff": "text/troff",
444
+ "man": "text/troff",
445
+ "me": "text/troff",
446
+ "ms": "text/troff",
447
+ "ttl": "text/turtle",
448
+ "uri": "text/uri-list",
449
+ "uris": "text/uri-list",
450
+ "urls": "text/uri-list",
451
+ "vcard": "text/vcard",
452
+ "vtt": "text/vtt",
453
+ "yaml": "text/yaml",
454
+ "yml": "text/yaml",
455
+ "3gp": "video/3gpp",
456
+ "3g2": "video/3gpp2",
457
+ "h261": "video/h261",
458
+ "h263": "video/h263",
459
+ "h264": "video/h264",
460
+ "m4s": "video/iso.segment",
461
+ "jpgv": "video/jpeg",
462
+ "jpgm": "image/jpm",
463
+ "mj2": "video/mj2",
464
+ "mjp2": "video/mj2",
465
+ "ts": "video/mp2t",
466
+ "mp4": "video/mp4",
467
+ "mp4v": "video/mp4",
468
+ "mpg4": "video/mp4",
469
+ "mpeg": "video/mpeg",
470
+ "mpg": "video/mpeg",
471
+ "mpe": "video/mpeg",
472
+ "m1v": "video/mpeg",
473
+ "m2v": "video/mpeg",
474
+ "ogv": "video/ogg",
475
+ "qt": "video/quicktime",
476
+ "mov": "video/quicktime",
477
+ "webm": "video/webm"
478
+ };
479
+
480
+ function lookup(extn) {
481
+ let tmp = ('' + extn).trim().toLowerCase();
482
+ let idx = tmp.lastIndexOf('.');
483
+ return mimes[!~idx ? tmp : tmp.substring(++idx)];
484
+ }
71
485
 
72
486
  const noop = () => {};
73
487
 
@@ -161,7 +575,7 @@ const ENCODING = {
161
575
  function toHeaders(name, stats, isEtag) {
162
576
  let enc = ENCODING[name.slice(-3)];
163
577
 
164
- let ctype = lite.getType(name.slice(0, enc && -3)) || '';
578
+ let ctype = lookup(name.slice(0, enc && -3)) || '';
165
579
  if (ctype === 'text/html') ctype += ';charset=utf-8';
166
580
 
167
581
  let headers = {
@@ -405,8 +819,8 @@ async function get_server(use_https, user_config, handler) {
405
819
 
406
820
  return Promise.resolve(
407
821
  use_https
408
- ? https.createServer(/** @type {https.ServerOptions} */ (https_options), handler)
409
- : http.createServer(handler)
822
+ ? require$$3.createServer(/** @type {https.ServerOptions} */ (https_options), handler)
823
+ : require$$2.createServer(handler)
410
824
  );
411
825
  }
412
826