unplugin-https-reverse-proxy 1.0.0-beta.15 → 1.0.0-beta.17

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.
@@ -0,0 +1,45 @@
1
+ // src/utils.ts
2
+ import process from "node:process";
3
+ import path from "node:path";
4
+ import { chmod, readdir, stat } from "node:fs/promises";
5
+ import { execSync } from "node:child_process";
6
+ import { createConsola } from "consola";
7
+ var consola = createConsola({
8
+ level: 3
9
+ }).withTag("reverse-proxy");
10
+ async function chmodRecursive(_path, mode) {
11
+ await chmod(_path, mode);
12
+ if ((await stat(_path)).isDirectory()) {
13
+ const children = await readdir(_path);
14
+ for (const child of children)
15
+ await chmodRecursive(path.join(_path, child), mode);
16
+ }
17
+ }
18
+ function once(fn) {
19
+ let called = false;
20
+ return (...args) => {
21
+ if (called)
22
+ return;
23
+ called = true;
24
+ return fn(...args);
25
+ };
26
+ }
27
+ function isAdmin() {
28
+ if (process.platform === "win32") {
29
+ try {
30
+ execSync("net session", { stdio: "ignore" });
31
+ return true;
32
+ } catch {
33
+ return false;
34
+ }
35
+ } else {
36
+ return process.getuid && process.getuid() === 0;
37
+ }
38
+ }
39
+
40
+ export {
41
+ consola,
42
+ chmodRecursive,
43
+ once,
44
+ isAdmin
45
+ };
@@ -0,0 +1,662 @@
1
+ import {
2
+ chmodRecursive,
3
+ consola,
4
+ isAdmin,
5
+ once
6
+ } from "./chunk-2VGRJ3QS.js";
7
+
8
+ // src/index.ts
9
+ import process4 from "node:process";
10
+ import { createUnplugin } from "unplugin";
11
+ import c from "picocolors";
12
+
13
+ // src/caddy/index.ts
14
+ import { platform } from "node:os";
15
+ import process3 from "node:process";
16
+ import { chmodSync as chmodSync2, createWriteStream, existsSync, mkdirSync, unlinkSync, writeFileSync } from "node:fs";
17
+ import { spawn } from "node:child_process";
18
+ import { readFile, unlink, writeFile } from "node:fs/promises";
19
+ import { got } from "got-cjs";
20
+ import { HttpProxyAgent } from "http-proxy-agent";
21
+ import { HttpsProxyAgent } from "https-proxy-agent";
22
+ import * as lockfile from "proper-lockfile";
23
+
24
+ // src/host/index.ts
25
+ import process from "node:process";
26
+ import { exec } from "node:child_process";
27
+ import { chmodSync } from "node:fs";
28
+ import { promisify } from "node:util";
29
+ import hostile from "hostile";
30
+ var _setHost = promisify(hostile.set);
31
+ var _removeHost = promisify(hostile.remove);
32
+ function getPathOfSystemHostsPath() {
33
+ return process.platform === "win32" ? `${process.env.windir || "C:\\WINDOWS"}\\system32\\drivers\\etc\\hosts` : "/etc/hosts";
34
+ }
35
+ async function syncHost() {
36
+ return new Promise((resolve, reject) => {
37
+ exec(
38
+ process.platform === "win32" ? "ipconfig /flushdns" : "sudo -E killall -HUP mDNSResponder",
39
+ (error, stdout, stderr) => {
40
+ if (error) {
41
+ consola.error(`exec error: ${error}`);
42
+ return resolve(false);
43
+ }
44
+ return resolve(true);
45
+ }
46
+ );
47
+ });
48
+ }
49
+ async function addHost(ip, host) {
50
+ if (process.platform !== "win32")
51
+ chmodSync(getPathOfSystemHostsPath(), 511);
52
+ await _setHost("127.0.0.1", "localhost");
53
+ await _setHost(ip, host);
54
+ if (ip === "localhost")
55
+ await _setHost("127.0.0.1", host);
56
+ return await syncHost();
57
+ }
58
+ async function removeHost(ip, host) {
59
+ if (process.platform !== "win32")
60
+ chmodSync(getPathOfSystemHostsPath(), 511);
61
+ await _removeHost(ip, host);
62
+ if (ip === "localhost")
63
+ await _removeHost("127.0.0.1", host);
64
+ return await syncHost();
65
+ }
66
+
67
+ // src/caddy/constants.ts
68
+ import { join } from "node:path";
69
+ import os from "node:os";
70
+ import process2 from "node:process";
71
+ import dotenvFlow from "dotenv-flow";
72
+ dotenvFlow.config({
73
+ silent: true
74
+ });
75
+ function resolvePath(path) {
76
+ if (path.startsWith("~"))
77
+ return join(os.homedir() || "", path.slice(1));
78
+ return path;
79
+ }
80
+ var TEMP_DIR = resolvePath(process2.env.UHRP_CADDY_PATH || process2.env.TEMP || process2.env.TMPDIR || "/tmp");
81
+ var caddyPath = join(TEMP_DIR, `caddy${process2.platform === "win32" ? ".exe" : ""}`);
82
+ var caddyFilePath = join(TEMP_DIR, "CADDYFILE");
83
+ var caddyLockFilePath = join(TEMP_DIR, "caddylock");
84
+ var supportList = [
85
+ {
86
+ platform: "dragonfly",
87
+ arch: "amd64"
88
+ },
89
+ {
90
+ platform: "freebsd",
91
+ arch: "amd64"
92
+ },
93
+ {
94
+ platform: "freebsd",
95
+ arch: "arm-6"
96
+ },
97
+ {
98
+ platform: "freebsd",
99
+ arch: "arm-7"
100
+ },
101
+ {
102
+ platform: "freebsd",
103
+ arch: "arm64"
104
+ },
105
+ {
106
+ platform: "linux",
107
+ arch: "amd64"
108
+ },
109
+ {
110
+ platform: "linux",
111
+ arch: "arm-5"
112
+ },
113
+ {
114
+ platform: "linux",
115
+ arch: "arm-6"
116
+ },
117
+ {
118
+ platform: "linux",
119
+ arch: "arm-7"
120
+ },
121
+ {
122
+ platform: "linux",
123
+ arch: "arm64"
124
+ },
125
+ {
126
+ platform: "linux",
127
+ arch: "mips"
128
+ },
129
+ {
130
+ platform: "linux",
131
+ arch: "mips64"
132
+ },
133
+ {
134
+ platform: "linux",
135
+ arch: "mips64le"
136
+ },
137
+ {
138
+ platform: "linux",
139
+ arch: "mipsle"
140
+ },
141
+ {
142
+ platform: "linux",
143
+ arch: "ppc64"
144
+ },
145
+ {
146
+ platform: "linux",
147
+ arch: "ppc64le"
148
+ },
149
+ {
150
+ platform: "linux",
151
+ arch: "s390x"
152
+ },
153
+ {
154
+ platform: "darwin",
155
+ arch: "amd64"
156
+ },
157
+ {
158
+ platform: "darwin",
159
+ arch: "arm64"
160
+ },
161
+ {
162
+ platform: "openbsd",
163
+ arch: "amd64"
164
+ },
165
+ {
166
+ platform: "openbsd",
167
+ arch: "arm-6"
168
+ },
169
+ {
170
+ platform: "openbsd",
171
+ arch: "arm-7"
172
+ },
173
+ {
174
+ platform: "openbsd",
175
+ arch: "arm64"
176
+ },
177
+ {
178
+ platform: "windows",
179
+ arch: "amd64"
180
+ },
181
+ {
182
+ platform: "windows",
183
+ arch: "arm-6"
184
+ },
185
+ {
186
+ platform: "windows",
187
+ arch: "arm-7"
188
+ },
189
+ {
190
+ platform: "windows",
191
+ arch: "arm64"
192
+ }
193
+ ];
194
+
195
+ // src/caddy/utils.ts
196
+ import { createServer } from "node:net";
197
+ import { exec as exec2 } from "node:child_process";
198
+ import ora from "ora";
199
+ var spinner;
200
+ function tryPort(port) {
201
+ return new Promise((resolve, reject) => {
202
+ try {
203
+ const server = createServer().listen(port);
204
+ server.on("listening", () => {
205
+ server.close();
206
+ resolve(false);
207
+ });
208
+ server.on("error", (err) => {
209
+ if (err.code === "EADDRINUSE")
210
+ resolve(true);
211
+ server.close();
212
+ });
213
+ } catch (e) {
214
+ resolve(true);
215
+ }
216
+ });
217
+ }
218
+ async function kill(port) {
219
+ return new Promise((resolve, reject) => {
220
+ exec2(`npx @maxbo/free-port ${port} -s`, (err, stdout, stderr) => {
221
+ if (err) {
222
+ reject(err);
223
+ } else {
224
+ consola.log(stdout);
225
+ resolve();
226
+ }
227
+ });
228
+ });
229
+ }
230
+ function getNumber(number) {
231
+ if (number <= 0)
232
+ return "0%";
233
+ else if (number < 100)
234
+ return `${number.toFixed(2)}%`;
235
+ else
236
+ return "100%";
237
+ }
238
+ function logProgress(percent) {
239
+ if (!spinner) {
240
+ consola.log("");
241
+ spinner = ora({
242
+ text: "Start Download Caddy: 0%",
243
+ indent: 2
244
+ });
245
+ spinner.start();
246
+ } else {
247
+ spinner.text = `Download Caddy: ${getNumber(Number(percent) * 100)}`;
248
+ }
249
+ }
250
+ function logProgressOver() {
251
+ if (!spinner) {
252
+ spinner = ora({
253
+ text: "Start Download Caddy: 100%",
254
+ indent: 2
255
+ });
256
+ spinner.start();
257
+ } else {
258
+ spinner.succeed();
259
+ consola.log("");
260
+ }
261
+ }
262
+
263
+ // src/caddy/index.ts
264
+ async function download() {
265
+ if (await testCaddy())
266
+ return caddyPath;
267
+ return new Promise((resolve, reject) => {
268
+ if (!existsSync(TEMP_DIR)) {
269
+ mkdirSync(TEMP_DIR, { recursive: true });
270
+ chmodSync2(TEMP_DIR, 511);
271
+ }
272
+ const file = createWriteStream(caddyPath);
273
+ let _platform = platform().toString();
274
+ _platform === "win32" && (_platform = "windows");
275
+ let _arch = process3.arch.toString();
276
+ _arch === "x64" && (_arch = "amd64");
277
+ const support = supportList.find((item) => item.platform === _platform && item.arch === _arch);
278
+ if (!support)
279
+ return reject(new Error("not support"));
280
+ const dowmloadLink = `https://caddyserver.com/api/download?os=${support.platform}&arch=${support.arch}`;
281
+ existsSync(caddyPath) && unlinkSync(caddyPath);
282
+ const httpProxy = process3.env.HTTP_PROXY || process3.env.http_proxy;
283
+ const httpsProxy = process3.env.HTTPS_PROXY || process3.env.https_proxy;
284
+ const httpAgent = httpProxy ? new HttpProxyAgent(httpProxy) : void 0;
285
+ const httpsAgent = httpsProxy ? new HttpsProxyAgent(httpsProxy) : void 0;
286
+ const chmodCaddyOnce = once(() => {
287
+ chmodSync2(caddyPath, 511);
288
+ });
289
+ got.stream(dowmloadLink, {
290
+ agent: {
291
+ http: httpAgent,
292
+ https: httpsAgent
293
+ }
294
+ }).on("downloadProgress", (progress) => {
295
+ logProgress(progress.percent);
296
+ chmodCaddyOnce();
297
+ }).pipe(file).on("finish", () => {
298
+ logProgressOver();
299
+ if (process3.platform === "win32")
300
+ return resolve(caddyPath);
301
+ chmodSync2(caddyPath, 511);
302
+ resolve(caddyPath);
303
+ }).on("error", (err) => {
304
+ reject(err);
305
+ });
306
+ });
307
+ }
308
+ function testCaddy() {
309
+ return new Promise((resolve, reject) => {
310
+ if (!existsSync(caddyPath))
311
+ return resolve(false);
312
+ chmodSync2(caddyPath, 511);
313
+ const child = process3.platform === "win32" ? spawn(caddyPath, []) : spawn("sudo", ["-E", caddyPath]);
314
+ child.on("close", () => {
315
+ return resolve(false);
316
+ });
317
+ child.on("error", (err) => {
318
+ return reject(err);
319
+ });
320
+ child.stdout.on("data", (_data) => {
321
+ return resolve(true);
322
+ });
323
+ });
324
+ }
325
+ var CaddyInstant = class {
326
+ constructor() {
327
+ this.inited = false;
328
+ this.stoped = false;
329
+ /** has locked */
330
+ this.locked = false;
331
+ testCaddy().then(async () => {
332
+ await this.getCaddyfile();
333
+ this.inited = true;
334
+ });
335
+ this.locked = this.checkLock();
336
+ }
337
+ checkLock() {
338
+ if (!existsSync(caddyLockFilePath))
339
+ writeFileSync(caddyLockFilePath, "");
340
+ return lockfile.checkSync(caddyLockFilePath);
341
+ }
342
+ async getCaddyfile() {
343
+ if (!existsSync(caddyFilePath))
344
+ await this.initCaddyfile();
345
+ this.caddyfile = await readFile(caddyFilePath, "utf-8");
346
+ return this.caddyfile;
347
+ }
348
+ async initCaddyfile() {
349
+ const contet = `
350
+ {
351
+ debug
352
+ auto_https disable_redirects
353
+ }
354
+
355
+ `;
356
+ await writeFile(caddyFilePath, contet);
357
+ this.caddyfile = contet;
358
+ }
359
+ async writeCaddyfile() {
360
+ return await writeFile(caddyFilePath, this.caddyfile || "");
361
+ }
362
+ async deleteCaddyfile() {
363
+ return await unlink(caddyFilePath);
364
+ }
365
+ async init() {
366
+ await download();
367
+ this.inited = true;
368
+ }
369
+ /**
370
+ * @param source like `127.0.0.1:8080`
371
+ * @param target like `test.abc.com`. And if you provide a port ,it will be ignore.
372
+ * @returns
373
+ */
374
+ async run(source, target, options) {
375
+ source = source.replace("0.0.0.0", "127.0.0.1");
376
+ const {
377
+ restore = true,
378
+ base = "/",
379
+ showCaddyLog = false,
380
+ https = false
381
+ } = options || {};
382
+ if (!this.inited)
383
+ await this.init();
384
+ if (!await addHost(source.split(":")[0], target.split(":")[0]))
385
+ throw new Error("update host failed");
386
+ consola.success("update host success\n");
387
+ await this.getCaddyfile();
388
+ if (!(this.caddyfile || "").includes(`${target.split(":")[0]}${https ? "" : ":80"}`)) {
389
+ this.caddyfile = `${this.caddyfile}
390
+ ${target.split(":")[0]}${https ? "" : ":80"} {
391
+ ${https ? "tls internal" : ""}
392
+ reverse_proxy http://${source}
393
+ }
394
+
395
+ `;
396
+ await this.writeCaddyfile();
397
+ }
398
+ if (!existsSync(caddyLockFilePath))
399
+ writeFileSync(caddyLockFilePath, "");
400
+ if (!this.locked) {
401
+ if (await tryPort(443))
402
+ await kill(443);
403
+ if ((process3.platform === "win32" || !https) && await tryPort(80))
404
+ await kill(80);
405
+ }
406
+ return new Promise((resolve, reject) => {
407
+ var _a, _b;
408
+ const setupCleanup = () => {
409
+ process3.on("SIGINT", async () => {
410
+ if (!restore || this.stoped)
411
+ return;
412
+ await this.baseCleanup();
413
+ try {
414
+ if (await removeHost(source.split(":")[0], target.split(":")[0]))
415
+ consola.success("Restore host success.\n");
416
+ else
417
+ consola.fail("Restore host failed.\n");
418
+ } catch (e) {
419
+ consola.error(e);
420
+ consola.fail("Restore host failed.\n");
421
+ } finally {
422
+ this.stoped = true;
423
+ process3.nextTick(() => {
424
+ process3.exit();
425
+ });
426
+ }
427
+ });
428
+ const originalExit = process3.exit.bind(process3);
429
+ process3.exit = async (code) => {
430
+ const port = Number(source.split(":")[1]);
431
+ if (!Number.isNaN(port) && await tryPort(port))
432
+ await kill(port);
433
+ const pwd = process3.cwd();
434
+ const viteCacheDir = `${pwd}/node_modules/.vite`;
435
+ if (existsSync(viteCacheDir))
436
+ chmodRecursive(viteCacheDir, 511);
437
+ const nuxtCacheDir = `${pwd}/.nuxt`;
438
+ if (existsSync(nuxtCacheDir))
439
+ await chmodRecursive(nuxtCacheDir, 511);
440
+ const webpackCacheDir = `${pwd}/node_modules/.cache`;
441
+ if (existsSync(webpackCacheDir))
442
+ chmodRecursive(webpackCacheDir, 511);
443
+ if (!restore || this.stoped)
444
+ return originalExit(code);
445
+ await this.baseCleanup();
446
+ try {
447
+ if (await removeHost(source.split(":")[0], target.split(":")[0]))
448
+ consola.success("Restore host success.\n");
449
+ else
450
+ consola.fail("Restore host failed.\n");
451
+ } catch (e) {
452
+ consola.error(e);
453
+ consola.fail("Restore host failed.\n");
454
+ } finally {
455
+ this.stoped = true;
456
+ process3.nextTick(() => {
457
+ originalExit(code);
458
+ });
459
+ }
460
+ };
461
+ };
462
+ if (!this.locked) {
463
+ this.caddyChild = process3.platform !== "win32" ? spawn("sudo", ["-E", caddyPath, "run", "--config", caddyFilePath, "--watch"]) : spawn(caddyPath, ["run", "--config", caddyFilePath, "--watch"]);
464
+ lockfile.lockSync(caddyLockFilePath);
465
+ this.caddyChild.on("error", (err) => {
466
+ return reject(err);
467
+ });
468
+ (_a = this.caddyChild.stderr) == null ? void 0 : _a.on("data", (data) => {
469
+ const lines = data.toString().split("\n").map((line) => line.trim());
470
+ for (const line of lines) {
471
+ showCaddyLog && line && console.info(line);
472
+ if (line.includes("Error:") || line && JSON.parse(line).level === "error") {
473
+ consola.error(`${line}
474
+ `);
475
+ return reject(line);
476
+ }
477
+ if (line.includes("config file changed"))
478
+ consola.success("Detect added a new reverse proxy config, restarted.\n");
479
+ if (line.includes("caddy proxying") || line.includes("serving initial"))
480
+ return resolve();
481
+ }
482
+ });
483
+ (_b = this.caddyChild.stdout) == null ? void 0 : _b.on("data", (_data) => {
484
+ consola.info(_data.toString());
485
+ resolve();
486
+ });
487
+ setupCleanup();
488
+ } else {
489
+ consola.info("Caddy is running in another process.");
490
+ setupCleanup();
491
+ return resolve();
492
+ }
493
+ });
494
+ }
495
+ async baseCleanup() {
496
+ var _a;
497
+ if (!this.locked) {
498
+ (_a = this.caddyChild) == null ? void 0 : _a.kill();
499
+ try {
500
+ await lockfile.unlock(caddyLockFilePath);
501
+ await unlink(caddyFilePath);
502
+ await unlink(caddyLockFilePath);
503
+ } catch (e) {
504
+ }
505
+ }
506
+ }
507
+ };
508
+
509
+ // src/index.ts
510
+ var config;
511
+ var caddy;
512
+ var cwd = process4.cwd();
513
+ var vitePrintUrls = once((options, source, target, base = "/", _printUrls) => {
514
+ _printUrls == null ? void 0 : _printUrls();
515
+ if (caddy)
516
+ return;
517
+ caddy = new CaddyInstant();
518
+ caddy.run(source, target, {
519
+ base,
520
+ ...options
521
+ }).then(() => {
522
+ const colorUrl = (url) => c.green(url.replace(/:(\d+)\//, (_, port) => `:${c.bold(port)}/`));
523
+ consola.success(` ${c.green("\u279C")} ${c.bold("run caddy reverse proxy success")}: ${colorUrl(`${options.https ? "https" : "http"}://${target}${base}`)}`);
524
+ }).catch((e) => {
525
+ throw e;
526
+ });
527
+ });
528
+ var unpluginFactory = (options) => ({
529
+ name: "unplugin-https-reverse-proxy",
530
+ enforce: "pre",
531
+ vite: {
532
+ configResolved(_config) {
533
+ config = _config;
534
+ },
535
+ configureServer(server) {
536
+ var _a;
537
+ if (config.command !== "serve")
538
+ return;
539
+ const {
540
+ enable = true,
541
+ target = ""
542
+ } = options;
543
+ if (!enable)
544
+ return;
545
+ if (!isAdmin()) {
546
+ consola.warn("please run as administrator");
547
+ return;
548
+ }
549
+ if (!target) {
550
+ consola.fail("please provide target");
551
+ return;
552
+ }
553
+ const _printUrls = server.printUrls.bind(server);
554
+ let source = `localhost:${config.server.port || 5173}`;
555
+ const url = (_a = server.resolvedUrls) == null ? void 0 : _a.local[0];
556
+ if (url) {
557
+ const u = new URL(url);
558
+ source = u.host;
559
+ }
560
+ const base = server.config.base || "/";
561
+ server.printUrls = () => vitePrintUrls(options, source, target, base, _printUrls);
562
+ }
563
+ },
564
+ webpack(compiler) {
565
+ var _a, _b;
566
+ if (process4.env.NODE_ENV !== "development")
567
+ return;
568
+ const {
569
+ enable = true,
570
+ target = ""
571
+ } = options;
572
+ if (!enable)
573
+ return;
574
+ if (!isAdmin()) {
575
+ consola.warn("please run as administrator");
576
+ return;
577
+ }
578
+ if (!target) {
579
+ consola.fail("please provide target");
580
+ return;
581
+ }
582
+ const devServer = {
583
+ host: "localhost",
584
+ port: 8080,
585
+ ...compiler.options.devServer,
586
+ // @ts-expect-error vuecli
587
+ ...(_a = process4.VUE_CLI_SERVICE) == null ? void 0 : _a.projectOptions.devServer
588
+ };
589
+ const source = `${devServer.host}:${devServer.port}`;
590
+ if (caddy)
591
+ return;
592
+ const _close = (_b = compiler.close) == null ? void 0 : _b.bind(compiler);
593
+ if (_close) {
594
+ compiler.close = async (callback) => {
595
+ process4.on("exit", () => {
596
+ _close && _close(callback);
597
+ });
598
+ };
599
+ } else {
600
+ options.https = false;
601
+ }
602
+ caddy = new CaddyInstant();
603
+ caddy.run(source, target, {
604
+ ...options
605
+ }).then(() => {
606
+ const colorUrl = (url) => c.green(url.replace(/:(\d+)\//, (_, port) => `:${c.bold(port)}/`));
607
+ compiler.hooks.done.tap("unplugin-https-reverse-proxy", () => {
608
+ consola.success(` ${c.green("\u279C")} ${c.bold("run caddy reverse proxy success")}: ${colorUrl(`${options.https ? "https" : "http"}://${target}`)}`);
609
+ });
610
+ }).catch((e) => {
611
+ throw e;
612
+ });
613
+ },
614
+ async rspack(compiler) {
615
+ var _a, _b, _c;
616
+ if (process4.env.NODE_ENV !== "development")
617
+ return;
618
+ const {
619
+ enable = true,
620
+ target = ""
621
+ } = options;
622
+ if (!enable)
623
+ return;
624
+ if (!isAdmin()) {
625
+ consola.warn("please run as administrator");
626
+ return;
627
+ }
628
+ if (!target) {
629
+ consola.fail("please provide target");
630
+ return;
631
+ }
632
+ const devServer = {
633
+ host: "localhost",
634
+ port: 8080,
635
+ ...compiler.options.devServer,
636
+ ...(_c = (_b = await ((_a = await import("@rsbuild/core")) == null ? void 0 : _a.loadConfig({
637
+ cwd
638
+ }))) == null ? void 0 : _b.content) == null ? void 0 : _c.server
639
+ };
640
+ const source = `${devServer.host}:${devServer.port}`;
641
+ if (caddy)
642
+ return;
643
+ caddy = new CaddyInstant();
644
+ caddy.run(source, target, {
645
+ ...options
646
+ }).then(() => {
647
+ const colorUrl = (url) => c.green(url.replace(/:(\d+)\//, (_, port) => `:${c.bold(port)}/`));
648
+ consola.success(` ${c.green("\u279C")} ${c.bold("run caddy reverse proxy success")}: ${colorUrl(`${options.https ? "https" : "http"}://${target}`)}`);
649
+ }).catch((e) => {
650
+ throw e;
651
+ });
652
+ }
653
+ });
654
+ var unplugin = /* @__PURE__ */ createUnplugin(unpluginFactory);
655
+ var src_default = unplugin;
656
+
657
+ export {
658
+ vitePrintUrls,
659
+ unpluginFactory,
660
+ unplugin,
661
+ src_default
662
+ };