unplugin-https-reverse-proxy 0.0.2 → 0.0.3
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.
- package/README.md +1 -0
- package/dist/{chunk-AIZ6VX2O.js → chunk-47EXOCHO.js} +1 -1
- package/dist/{chunk-FTJKGYCT.js → chunk-HSZFTLD3.js} +23 -10
- package/dist/{chunk-TFGTJLXH.js → chunk-Q7EG3ZFW.js} +1 -1
- package/dist/esbuild.cjs +23 -10
- package/dist/esbuild.js +1 -1
- package/dist/index.cjs +23 -10
- package/dist/index.js +1 -1
- package/dist/nuxt.cjs +23 -10
- package/dist/nuxt.js +3 -3
- package/dist/rollup.cjs +23 -10
- package/dist/rollup.js +1 -1
- package/dist/vite.cjs +23 -10
- package/dist/vite.js +2 -2
- package/dist/webpack.cjs +23 -10
- package/dist/webpack.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ import kill from "kill-port";
|
|
|
18
18
|
import { join } from "path";
|
|
19
19
|
import process from "process";
|
|
20
20
|
var TEMP_DIR = process.env.TEMP || process.env.TMPDIR || "/tmp";
|
|
21
|
-
var caddyPath = join(TEMP_DIR,
|
|
21
|
+
var caddyPath = join(TEMP_DIR, `caddy${process.platform === "win32" ? ".exe" : ""}`);
|
|
22
22
|
var caddyFilePath = join(TEMP_DIR, "CADDYFILE");
|
|
23
23
|
var supportList = [
|
|
24
24
|
{
|
|
@@ -191,7 +191,7 @@ function testCaddy() {
|
|
|
191
191
|
if (!existsSync(caddyPath))
|
|
192
192
|
return resolve(false);
|
|
193
193
|
chmodSync(caddyPath, 493);
|
|
194
|
-
const child = spawn("sudo", [caddyPath]);
|
|
194
|
+
const child = process2.platform === "win32" ? spawn(caddyPath, []) : spawn("sudo", [caddyPath]);
|
|
195
195
|
child.on("error", (err) => {
|
|
196
196
|
reject(err);
|
|
197
197
|
});
|
|
@@ -265,8 +265,9 @@ var CaddyInstant = class {
|
|
|
265
265
|
* @returns
|
|
266
266
|
*/
|
|
267
267
|
async run(source, target, options) {
|
|
268
|
+
source = source.replace("0.0.0.0", "127.0.0.1").replace("localhost", "127.0.0.1");
|
|
268
269
|
const {
|
|
269
|
-
restore =
|
|
270
|
+
restore = true,
|
|
270
271
|
base = "/"
|
|
271
272
|
} = options || {};
|
|
272
273
|
if (!this.inited)
|
|
@@ -275,8 +276,10 @@ var CaddyInstant = class {
|
|
|
275
276
|
throw new Error("update host failed");
|
|
276
277
|
if (await tryPort(443))
|
|
277
278
|
await kill(443, "tcp");
|
|
279
|
+
if (await tryPort(80))
|
|
280
|
+
await kill(80, "tcp");
|
|
278
281
|
return new Promise((resolve, reject) => {
|
|
279
|
-
const child = spawn("sudo", [caddyPath, "reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]);
|
|
282
|
+
const child = process2.platform !== "win32" ? spawn("sudo", [caddyPath, "reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]) : spawn(caddyPath, ["reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]);
|
|
280
283
|
child.on("error", (err) => {
|
|
281
284
|
return reject(err);
|
|
282
285
|
});
|
|
@@ -304,8 +307,10 @@ var CaddyInstant = class {
|
|
|
304
307
|
|
|
305
308
|
// src/index.ts
|
|
306
309
|
var config;
|
|
310
|
+
var caddy;
|
|
307
311
|
var unpluginFactory = (options) => ({
|
|
308
312
|
name: "unplugin-https-reverse-proxy",
|
|
313
|
+
enforce: "post",
|
|
309
314
|
vite: {
|
|
310
315
|
configResolved(_config) {
|
|
311
316
|
config = _config;
|
|
@@ -328,8 +333,8 @@ var unpluginFactory = (options) => ({
|
|
|
328
333
|
}
|
|
329
334
|
const base = server.config.base || "/";
|
|
330
335
|
try {
|
|
331
|
-
const
|
|
332
|
-
|
|
336
|
+
const caddy2 = new CaddyInstant();
|
|
337
|
+
caddy2.run(source, target, {
|
|
333
338
|
base
|
|
334
339
|
}).then((stop) => {
|
|
335
340
|
const colorUrl = (url2) => c.green(url2.replace(/:(\d+)\//, (_, port) => `:${c.bold(port)}/`));
|
|
@@ -347,7 +352,6 @@ var unpluginFactory = (options) => ({
|
|
|
347
352
|
}
|
|
348
353
|
},
|
|
349
354
|
webpack(compiler) {
|
|
350
|
-
var _a, _b;
|
|
351
355
|
const {
|
|
352
356
|
target = ""
|
|
353
357
|
} = options;
|
|
@@ -355,16 +359,25 @@ var unpluginFactory = (options) => ({
|
|
|
355
359
|
console.log("please provide target");
|
|
356
360
|
return;
|
|
357
361
|
}
|
|
358
|
-
const source = `${((_a = compiler.options.devServer) == null ? void 0 : _a.host) || "127.0.0.1"}:${((_b = compiler.options.devServer) == null ? void 0 : _b.port) || "8080"}`;
|
|
359
362
|
try {
|
|
360
|
-
const
|
|
363
|
+
const devServer = compiler.options.devServer || process3.VUE_CLI_SERVICE.projectOptions.devServer;
|
|
364
|
+
const source = `${(devServer == null ? void 0 : devServer.host) || "127.0.0.1"}:${(devServer == null ? void 0 : devServer.port) || "8080"}`;
|
|
365
|
+
if (caddy)
|
|
366
|
+
return;
|
|
367
|
+
caddy = new CaddyInstant();
|
|
361
368
|
caddy.run(source, target).then((stop) => {
|
|
362
369
|
const colorUrl = (url) => c.green(url.replace(/:(\d+)\//, (_, port) => `:${c.bold(port)}/`));
|
|
363
|
-
|
|
370
|
+
compiler.hooks.done.tap("unplugin-https-reverse-proxy", (stats) => {
|
|
371
|
+
if (stats.hasErrors())
|
|
372
|
+
return;
|
|
373
|
+
console.log(` ${c.green("\u279C")} ${c.bold("run caddy reverse proxy success")}: ${colorUrl(`https://${target}`)}`);
|
|
374
|
+
});
|
|
364
375
|
process3.on("SIGINT", async () => {
|
|
365
376
|
await stop();
|
|
366
377
|
process3.exit();
|
|
367
378
|
});
|
|
379
|
+
}).catch((e) => {
|
|
380
|
+
throw e;
|
|
368
381
|
});
|
|
369
382
|
} catch (e) {
|
|
370
383
|
console.error(e);
|
package/dist/esbuild.cjs
CHANGED
|
@@ -55,7 +55,7 @@ var import_kill_port = __toESM(require("kill-port"), 1);
|
|
|
55
55
|
var import_node_path = require("path");
|
|
56
56
|
var import_node_process = __toESM(require("process"), 1);
|
|
57
57
|
var TEMP_DIR = import_node_process.default.env.TEMP || import_node_process.default.env.TMPDIR || "/tmp";
|
|
58
|
-
var caddyPath = (0, import_node_path.join)(TEMP_DIR,
|
|
58
|
+
var caddyPath = (0, import_node_path.join)(TEMP_DIR, `caddy${import_node_process.default.platform === "win32" ? ".exe" : ""}`);
|
|
59
59
|
var caddyFilePath = (0, import_node_path.join)(TEMP_DIR, "CADDYFILE");
|
|
60
60
|
var supportList = [
|
|
61
61
|
{
|
|
@@ -228,7 +228,7 @@ function testCaddy() {
|
|
|
228
228
|
if (!(0, import_node_fs.existsSync)(caddyPath))
|
|
229
229
|
return resolve(false);
|
|
230
230
|
(0, import_node_fs.chmodSync)(caddyPath, 493);
|
|
231
|
-
const child = (0, import_node_child_process.spawn)("sudo", [caddyPath]);
|
|
231
|
+
const child = import_node_process2.default.platform === "win32" ? (0, import_node_child_process.spawn)(caddyPath, []) : (0, import_node_child_process.spawn)("sudo", [caddyPath]);
|
|
232
232
|
child.on("error", (err) => {
|
|
233
233
|
reject(err);
|
|
234
234
|
});
|
|
@@ -302,8 +302,9 @@ var CaddyInstant = class {
|
|
|
302
302
|
* @returns
|
|
303
303
|
*/
|
|
304
304
|
async run(source, target, options) {
|
|
305
|
+
source = source.replace("0.0.0.0", "127.0.0.1").replace("localhost", "127.0.0.1");
|
|
305
306
|
const {
|
|
306
|
-
restore =
|
|
307
|
+
restore = true,
|
|
307
308
|
base = "/"
|
|
308
309
|
} = options || {};
|
|
309
310
|
if (!this.inited)
|
|
@@ -312,8 +313,10 @@ var CaddyInstant = class {
|
|
|
312
313
|
throw new Error("update host failed");
|
|
313
314
|
if (await tryPort(443))
|
|
314
315
|
await (0, import_kill_port.default)(443, "tcp");
|
|
316
|
+
if (await tryPort(80))
|
|
317
|
+
await (0, import_kill_port.default)(80, "tcp");
|
|
315
318
|
return new Promise((resolve, reject) => {
|
|
316
|
-
const child = (0, import_node_child_process.spawn)("sudo", [caddyPath, "reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]);
|
|
319
|
+
const child = import_node_process2.default.platform !== "win32" ? (0, import_node_child_process.spawn)("sudo", [caddyPath, "reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]) : (0, import_node_child_process.spawn)(caddyPath, ["reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]);
|
|
317
320
|
child.on("error", (err) => {
|
|
318
321
|
return reject(err);
|
|
319
322
|
});
|
|
@@ -341,8 +344,10 @@ var CaddyInstant = class {
|
|
|
341
344
|
|
|
342
345
|
// src/index.ts
|
|
343
346
|
var config;
|
|
347
|
+
var caddy;
|
|
344
348
|
var unpluginFactory = (options) => ({
|
|
345
349
|
name: "unplugin-https-reverse-proxy",
|
|
350
|
+
enforce: "post",
|
|
346
351
|
vite: {
|
|
347
352
|
configResolved(_config) {
|
|
348
353
|
config = _config;
|
|
@@ -365,8 +370,8 @@ var unpluginFactory = (options) => ({
|
|
|
365
370
|
}
|
|
366
371
|
const base = server.config.base || "/";
|
|
367
372
|
try {
|
|
368
|
-
const
|
|
369
|
-
|
|
373
|
+
const caddy2 = new CaddyInstant();
|
|
374
|
+
caddy2.run(source, target, {
|
|
370
375
|
base
|
|
371
376
|
}).then((stop) => {
|
|
372
377
|
const colorUrl = (url2) => import_picocolors.default.green(url2.replace(/:(\d+)\//, (_, port) => `:${import_picocolors.default.bold(port)}/`));
|
|
@@ -384,7 +389,6 @@ var unpluginFactory = (options) => ({
|
|
|
384
389
|
}
|
|
385
390
|
},
|
|
386
391
|
webpack(compiler) {
|
|
387
|
-
var _a, _b;
|
|
388
392
|
const {
|
|
389
393
|
target = ""
|
|
390
394
|
} = options;
|
|
@@ -392,16 +396,25 @@ var unpluginFactory = (options) => ({
|
|
|
392
396
|
console.log("please provide target");
|
|
393
397
|
return;
|
|
394
398
|
}
|
|
395
|
-
const source = `${((_a = compiler.options.devServer) == null ? void 0 : _a.host) || "127.0.0.1"}:${((_b = compiler.options.devServer) == null ? void 0 : _b.port) || "8080"}`;
|
|
396
399
|
try {
|
|
397
|
-
const
|
|
400
|
+
const devServer = compiler.options.devServer || import_node_process3.default.VUE_CLI_SERVICE.projectOptions.devServer;
|
|
401
|
+
const source = `${(devServer == null ? void 0 : devServer.host) || "127.0.0.1"}:${(devServer == null ? void 0 : devServer.port) || "8080"}`;
|
|
402
|
+
if (caddy)
|
|
403
|
+
return;
|
|
404
|
+
caddy = new CaddyInstant();
|
|
398
405
|
caddy.run(source, target).then((stop) => {
|
|
399
406
|
const colorUrl = (url) => import_picocolors.default.green(url.replace(/:(\d+)\//, (_, port) => `:${import_picocolors.default.bold(port)}/`));
|
|
400
|
-
|
|
407
|
+
compiler.hooks.done.tap("unplugin-https-reverse-proxy", (stats) => {
|
|
408
|
+
if (stats.hasErrors())
|
|
409
|
+
return;
|
|
410
|
+
console.log(` ${import_picocolors.default.green("\u279C")} ${import_picocolors.default.bold("run caddy reverse proxy success")}: ${colorUrl(`https://${target}`)}`);
|
|
411
|
+
});
|
|
401
412
|
import_node_process3.default.on("SIGINT", async () => {
|
|
402
413
|
await stop();
|
|
403
414
|
import_node_process3.default.exit();
|
|
404
415
|
});
|
|
416
|
+
}).catch((e) => {
|
|
417
|
+
throw e;
|
|
405
418
|
});
|
|
406
419
|
} catch (e) {
|
|
407
420
|
console.error(e);
|
package/dist/esbuild.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -54,7 +54,7 @@ var import_kill_port = __toESM(require("kill-port"), 1);
|
|
|
54
54
|
var import_node_path = require("path");
|
|
55
55
|
var import_node_process = __toESM(require("process"), 1);
|
|
56
56
|
var TEMP_DIR = import_node_process.default.env.TEMP || import_node_process.default.env.TMPDIR || "/tmp";
|
|
57
|
-
var caddyPath = (0, import_node_path.join)(TEMP_DIR,
|
|
57
|
+
var caddyPath = (0, import_node_path.join)(TEMP_DIR, `caddy${import_node_process.default.platform === "win32" ? ".exe" : ""}`);
|
|
58
58
|
var caddyFilePath = (0, import_node_path.join)(TEMP_DIR, "CADDYFILE");
|
|
59
59
|
var supportList = [
|
|
60
60
|
{
|
|
@@ -227,7 +227,7 @@ function testCaddy() {
|
|
|
227
227
|
if (!(0, import_node_fs.existsSync)(caddyPath))
|
|
228
228
|
return resolve(false);
|
|
229
229
|
(0, import_node_fs.chmodSync)(caddyPath, 493);
|
|
230
|
-
const child = (0, import_node_child_process.spawn)("sudo", [caddyPath]);
|
|
230
|
+
const child = import_node_process2.default.platform === "win32" ? (0, import_node_child_process.spawn)(caddyPath, []) : (0, import_node_child_process.spawn)("sudo", [caddyPath]);
|
|
231
231
|
child.on("error", (err) => {
|
|
232
232
|
reject(err);
|
|
233
233
|
});
|
|
@@ -301,8 +301,9 @@ var CaddyInstant = class {
|
|
|
301
301
|
* @returns
|
|
302
302
|
*/
|
|
303
303
|
async run(source, target, options) {
|
|
304
|
+
source = source.replace("0.0.0.0", "127.0.0.1").replace("localhost", "127.0.0.1");
|
|
304
305
|
const {
|
|
305
|
-
restore =
|
|
306
|
+
restore = true,
|
|
306
307
|
base = "/"
|
|
307
308
|
} = options || {};
|
|
308
309
|
if (!this.inited)
|
|
@@ -311,8 +312,10 @@ var CaddyInstant = class {
|
|
|
311
312
|
throw new Error("update host failed");
|
|
312
313
|
if (await tryPort(443))
|
|
313
314
|
await (0, import_kill_port.default)(443, "tcp");
|
|
315
|
+
if (await tryPort(80))
|
|
316
|
+
await (0, import_kill_port.default)(80, "tcp");
|
|
314
317
|
return new Promise((resolve, reject) => {
|
|
315
|
-
const child = (0, import_node_child_process.spawn)("sudo", [caddyPath, "reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]);
|
|
318
|
+
const child = import_node_process2.default.platform !== "win32" ? (0, import_node_child_process.spawn)("sudo", [caddyPath, "reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]) : (0, import_node_child_process.spawn)(caddyPath, ["reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]);
|
|
316
319
|
child.on("error", (err) => {
|
|
317
320
|
return reject(err);
|
|
318
321
|
});
|
|
@@ -340,8 +343,10 @@ var CaddyInstant = class {
|
|
|
340
343
|
|
|
341
344
|
// src/index.ts
|
|
342
345
|
var config;
|
|
346
|
+
var caddy;
|
|
343
347
|
var unpluginFactory = (options) => ({
|
|
344
348
|
name: "unplugin-https-reverse-proxy",
|
|
349
|
+
enforce: "post",
|
|
345
350
|
vite: {
|
|
346
351
|
configResolved(_config) {
|
|
347
352
|
config = _config;
|
|
@@ -364,8 +369,8 @@ var unpluginFactory = (options) => ({
|
|
|
364
369
|
}
|
|
365
370
|
const base = server.config.base || "/";
|
|
366
371
|
try {
|
|
367
|
-
const
|
|
368
|
-
|
|
372
|
+
const caddy2 = new CaddyInstant();
|
|
373
|
+
caddy2.run(source, target, {
|
|
369
374
|
base
|
|
370
375
|
}).then((stop) => {
|
|
371
376
|
const colorUrl = (url2) => import_picocolors.default.green(url2.replace(/:(\d+)\//, (_, port) => `:${import_picocolors.default.bold(port)}/`));
|
|
@@ -383,7 +388,6 @@ var unpluginFactory = (options) => ({
|
|
|
383
388
|
}
|
|
384
389
|
},
|
|
385
390
|
webpack(compiler) {
|
|
386
|
-
var _a, _b;
|
|
387
391
|
const {
|
|
388
392
|
target = ""
|
|
389
393
|
} = options;
|
|
@@ -391,16 +395,25 @@ var unpluginFactory = (options) => ({
|
|
|
391
395
|
console.log("please provide target");
|
|
392
396
|
return;
|
|
393
397
|
}
|
|
394
|
-
const source = `${((_a = compiler.options.devServer) == null ? void 0 : _a.host) || "127.0.0.1"}:${((_b = compiler.options.devServer) == null ? void 0 : _b.port) || "8080"}`;
|
|
395
398
|
try {
|
|
396
|
-
const
|
|
399
|
+
const devServer = compiler.options.devServer || import_node_process3.default.VUE_CLI_SERVICE.projectOptions.devServer;
|
|
400
|
+
const source = `${(devServer == null ? void 0 : devServer.host) || "127.0.0.1"}:${(devServer == null ? void 0 : devServer.port) || "8080"}`;
|
|
401
|
+
if (caddy)
|
|
402
|
+
return;
|
|
403
|
+
caddy = new CaddyInstant();
|
|
397
404
|
caddy.run(source, target).then((stop) => {
|
|
398
405
|
const colorUrl = (url) => import_picocolors.default.green(url.replace(/:(\d+)\//, (_, port) => `:${import_picocolors.default.bold(port)}/`));
|
|
399
|
-
|
|
406
|
+
compiler.hooks.done.tap("unplugin-https-reverse-proxy", (stats) => {
|
|
407
|
+
if (stats.hasErrors())
|
|
408
|
+
return;
|
|
409
|
+
console.log(` ${import_picocolors.default.green("\u279C")} ${import_picocolors.default.bold("run caddy reverse proxy success")}: ${colorUrl(`https://${target}`)}`);
|
|
410
|
+
});
|
|
400
411
|
import_node_process3.default.on("SIGINT", async () => {
|
|
401
412
|
await stop();
|
|
402
413
|
import_node_process3.default.exit();
|
|
403
414
|
});
|
|
415
|
+
}).catch((e) => {
|
|
416
|
+
throw e;
|
|
404
417
|
});
|
|
405
418
|
} catch (e) {
|
|
406
419
|
console.error(e);
|
package/dist/index.js
CHANGED
package/dist/nuxt.cjs
CHANGED
|
@@ -58,7 +58,7 @@ var import_kill_port = __toESM(require("kill-port"), 1);
|
|
|
58
58
|
var import_node_path = require("path");
|
|
59
59
|
var import_node_process = __toESM(require("process"), 1);
|
|
60
60
|
var TEMP_DIR = import_node_process.default.env.TEMP || import_node_process.default.env.TMPDIR || "/tmp";
|
|
61
|
-
var caddyPath = (0, import_node_path.join)(TEMP_DIR,
|
|
61
|
+
var caddyPath = (0, import_node_path.join)(TEMP_DIR, `caddy${import_node_process.default.platform === "win32" ? ".exe" : ""}`);
|
|
62
62
|
var caddyFilePath = (0, import_node_path.join)(TEMP_DIR, "CADDYFILE");
|
|
63
63
|
var supportList = [
|
|
64
64
|
{
|
|
@@ -231,7 +231,7 @@ function testCaddy() {
|
|
|
231
231
|
if (!(0, import_node_fs.existsSync)(caddyPath))
|
|
232
232
|
return resolve(false);
|
|
233
233
|
(0, import_node_fs.chmodSync)(caddyPath, 493);
|
|
234
|
-
const child = (0, import_node_child_process.spawn)("sudo", [caddyPath]);
|
|
234
|
+
const child = import_node_process2.default.platform === "win32" ? (0, import_node_child_process.spawn)(caddyPath, []) : (0, import_node_child_process.spawn)("sudo", [caddyPath]);
|
|
235
235
|
child.on("error", (err) => {
|
|
236
236
|
reject(err);
|
|
237
237
|
});
|
|
@@ -305,8 +305,9 @@ var CaddyInstant = class {
|
|
|
305
305
|
* @returns
|
|
306
306
|
*/
|
|
307
307
|
async run(source, target, options) {
|
|
308
|
+
source = source.replace("0.0.0.0", "127.0.0.1").replace("localhost", "127.0.0.1");
|
|
308
309
|
const {
|
|
309
|
-
restore =
|
|
310
|
+
restore = true,
|
|
310
311
|
base = "/"
|
|
311
312
|
} = options || {};
|
|
312
313
|
if (!this.inited)
|
|
@@ -315,8 +316,10 @@ var CaddyInstant = class {
|
|
|
315
316
|
throw new Error("update host failed");
|
|
316
317
|
if (await tryPort(443))
|
|
317
318
|
await (0, import_kill_port.default)(443, "tcp");
|
|
319
|
+
if (await tryPort(80))
|
|
320
|
+
await (0, import_kill_port.default)(80, "tcp");
|
|
318
321
|
return new Promise((resolve, reject) => {
|
|
319
|
-
const child = (0, import_node_child_process.spawn)("sudo", [caddyPath, "reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]);
|
|
322
|
+
const child = import_node_process2.default.platform !== "win32" ? (0, import_node_child_process.spawn)("sudo", [caddyPath, "reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]) : (0, import_node_child_process.spawn)(caddyPath, ["reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]);
|
|
320
323
|
child.on("error", (err) => {
|
|
321
324
|
return reject(err);
|
|
322
325
|
});
|
|
@@ -344,8 +347,10 @@ var CaddyInstant = class {
|
|
|
344
347
|
|
|
345
348
|
// src/index.ts
|
|
346
349
|
var config;
|
|
350
|
+
var caddy;
|
|
347
351
|
var unpluginFactory = (options) => ({
|
|
348
352
|
name: "unplugin-https-reverse-proxy",
|
|
353
|
+
enforce: "post",
|
|
349
354
|
vite: {
|
|
350
355
|
configResolved(_config) {
|
|
351
356
|
config = _config;
|
|
@@ -368,8 +373,8 @@ var unpluginFactory = (options) => ({
|
|
|
368
373
|
}
|
|
369
374
|
const base = server.config.base || "/";
|
|
370
375
|
try {
|
|
371
|
-
const
|
|
372
|
-
|
|
376
|
+
const caddy2 = new CaddyInstant();
|
|
377
|
+
caddy2.run(source, target, {
|
|
373
378
|
base
|
|
374
379
|
}).then((stop) => {
|
|
375
380
|
const colorUrl = (url2) => import_picocolors.default.green(url2.replace(/:(\d+)\//, (_, port) => `:${import_picocolors.default.bold(port)}/`));
|
|
@@ -387,7 +392,6 @@ var unpluginFactory = (options) => ({
|
|
|
387
392
|
}
|
|
388
393
|
},
|
|
389
394
|
webpack(compiler) {
|
|
390
|
-
var _a, _b;
|
|
391
395
|
const {
|
|
392
396
|
target = ""
|
|
393
397
|
} = options;
|
|
@@ -395,16 +399,25 @@ var unpluginFactory = (options) => ({
|
|
|
395
399
|
console.log("please provide target");
|
|
396
400
|
return;
|
|
397
401
|
}
|
|
398
|
-
const source = `${((_a = compiler.options.devServer) == null ? void 0 : _a.host) || "127.0.0.1"}:${((_b = compiler.options.devServer) == null ? void 0 : _b.port) || "8080"}`;
|
|
399
402
|
try {
|
|
400
|
-
const
|
|
403
|
+
const devServer = compiler.options.devServer || import_node_process3.default.VUE_CLI_SERVICE.projectOptions.devServer;
|
|
404
|
+
const source = `${(devServer == null ? void 0 : devServer.host) || "127.0.0.1"}:${(devServer == null ? void 0 : devServer.port) || "8080"}`;
|
|
405
|
+
if (caddy)
|
|
406
|
+
return;
|
|
407
|
+
caddy = new CaddyInstant();
|
|
401
408
|
caddy.run(source, target).then((stop) => {
|
|
402
409
|
const colorUrl = (url) => import_picocolors.default.green(url.replace(/:(\d+)\//, (_, port) => `:${import_picocolors.default.bold(port)}/`));
|
|
403
|
-
|
|
410
|
+
compiler.hooks.done.tap("unplugin-https-reverse-proxy", (stats) => {
|
|
411
|
+
if (stats.hasErrors())
|
|
412
|
+
return;
|
|
413
|
+
console.log(` ${import_picocolors.default.green("\u279C")} ${import_picocolors.default.bold("run caddy reverse proxy success")}: ${colorUrl(`https://${target}`)}`);
|
|
414
|
+
});
|
|
404
415
|
import_node_process3.default.on("SIGINT", async () => {
|
|
405
416
|
await stop();
|
|
406
417
|
import_node_process3.default.exit();
|
|
407
418
|
});
|
|
419
|
+
}).catch((e) => {
|
|
420
|
+
throw e;
|
|
408
421
|
});
|
|
409
422
|
} catch (e) {
|
|
410
423
|
console.error(e);
|
package/dist/nuxt.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
vite_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-47EXOCHO.js";
|
|
4
4
|
import {
|
|
5
5
|
webpack_default
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-Q7EG3ZFW.js";
|
|
7
|
+
import "./chunk-HSZFTLD3.js";
|
|
8
8
|
|
|
9
9
|
// src/nuxt.ts
|
|
10
10
|
import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from "@nuxt/kit";
|
package/dist/rollup.cjs
CHANGED
|
@@ -55,7 +55,7 @@ var import_kill_port = __toESM(require("kill-port"), 1);
|
|
|
55
55
|
var import_node_path = require("path");
|
|
56
56
|
var import_node_process = __toESM(require("process"), 1);
|
|
57
57
|
var TEMP_DIR = import_node_process.default.env.TEMP || import_node_process.default.env.TMPDIR || "/tmp";
|
|
58
|
-
var caddyPath = (0, import_node_path.join)(TEMP_DIR,
|
|
58
|
+
var caddyPath = (0, import_node_path.join)(TEMP_DIR, `caddy${import_node_process.default.platform === "win32" ? ".exe" : ""}`);
|
|
59
59
|
var caddyFilePath = (0, import_node_path.join)(TEMP_DIR, "CADDYFILE");
|
|
60
60
|
var supportList = [
|
|
61
61
|
{
|
|
@@ -228,7 +228,7 @@ function testCaddy() {
|
|
|
228
228
|
if (!(0, import_node_fs.existsSync)(caddyPath))
|
|
229
229
|
return resolve(false);
|
|
230
230
|
(0, import_node_fs.chmodSync)(caddyPath, 493);
|
|
231
|
-
const child = (0, import_node_child_process.spawn)("sudo", [caddyPath]);
|
|
231
|
+
const child = import_node_process2.default.platform === "win32" ? (0, import_node_child_process.spawn)(caddyPath, []) : (0, import_node_child_process.spawn)("sudo", [caddyPath]);
|
|
232
232
|
child.on("error", (err) => {
|
|
233
233
|
reject(err);
|
|
234
234
|
});
|
|
@@ -302,8 +302,9 @@ var CaddyInstant = class {
|
|
|
302
302
|
* @returns
|
|
303
303
|
*/
|
|
304
304
|
async run(source, target, options) {
|
|
305
|
+
source = source.replace("0.0.0.0", "127.0.0.1").replace("localhost", "127.0.0.1");
|
|
305
306
|
const {
|
|
306
|
-
restore =
|
|
307
|
+
restore = true,
|
|
307
308
|
base = "/"
|
|
308
309
|
} = options || {};
|
|
309
310
|
if (!this.inited)
|
|
@@ -312,8 +313,10 @@ var CaddyInstant = class {
|
|
|
312
313
|
throw new Error("update host failed");
|
|
313
314
|
if (await tryPort(443))
|
|
314
315
|
await (0, import_kill_port.default)(443, "tcp");
|
|
316
|
+
if (await tryPort(80))
|
|
317
|
+
await (0, import_kill_port.default)(80, "tcp");
|
|
315
318
|
return new Promise((resolve, reject) => {
|
|
316
|
-
const child = (0, import_node_child_process.spawn)("sudo", [caddyPath, "reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]);
|
|
319
|
+
const child = import_node_process2.default.platform !== "win32" ? (0, import_node_child_process.spawn)("sudo", [caddyPath, "reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]) : (0, import_node_child_process.spawn)(caddyPath, ["reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]);
|
|
317
320
|
child.on("error", (err) => {
|
|
318
321
|
return reject(err);
|
|
319
322
|
});
|
|
@@ -341,8 +344,10 @@ var CaddyInstant = class {
|
|
|
341
344
|
|
|
342
345
|
// src/index.ts
|
|
343
346
|
var config;
|
|
347
|
+
var caddy;
|
|
344
348
|
var unpluginFactory = (options) => ({
|
|
345
349
|
name: "unplugin-https-reverse-proxy",
|
|
350
|
+
enforce: "post",
|
|
346
351
|
vite: {
|
|
347
352
|
configResolved(_config) {
|
|
348
353
|
config = _config;
|
|
@@ -365,8 +370,8 @@ var unpluginFactory = (options) => ({
|
|
|
365
370
|
}
|
|
366
371
|
const base = server.config.base || "/";
|
|
367
372
|
try {
|
|
368
|
-
const
|
|
369
|
-
|
|
373
|
+
const caddy2 = new CaddyInstant();
|
|
374
|
+
caddy2.run(source, target, {
|
|
370
375
|
base
|
|
371
376
|
}).then((stop) => {
|
|
372
377
|
const colorUrl = (url2) => import_picocolors.default.green(url2.replace(/:(\d+)\//, (_, port) => `:${import_picocolors.default.bold(port)}/`));
|
|
@@ -384,7 +389,6 @@ var unpluginFactory = (options) => ({
|
|
|
384
389
|
}
|
|
385
390
|
},
|
|
386
391
|
webpack(compiler) {
|
|
387
|
-
var _a, _b;
|
|
388
392
|
const {
|
|
389
393
|
target = ""
|
|
390
394
|
} = options;
|
|
@@ -392,16 +396,25 @@ var unpluginFactory = (options) => ({
|
|
|
392
396
|
console.log("please provide target");
|
|
393
397
|
return;
|
|
394
398
|
}
|
|
395
|
-
const source = `${((_a = compiler.options.devServer) == null ? void 0 : _a.host) || "127.0.0.1"}:${((_b = compiler.options.devServer) == null ? void 0 : _b.port) || "8080"}`;
|
|
396
399
|
try {
|
|
397
|
-
const
|
|
400
|
+
const devServer = compiler.options.devServer || import_node_process3.default.VUE_CLI_SERVICE.projectOptions.devServer;
|
|
401
|
+
const source = `${(devServer == null ? void 0 : devServer.host) || "127.0.0.1"}:${(devServer == null ? void 0 : devServer.port) || "8080"}`;
|
|
402
|
+
if (caddy)
|
|
403
|
+
return;
|
|
404
|
+
caddy = new CaddyInstant();
|
|
398
405
|
caddy.run(source, target).then((stop) => {
|
|
399
406
|
const colorUrl = (url) => import_picocolors.default.green(url.replace(/:(\d+)\//, (_, port) => `:${import_picocolors.default.bold(port)}/`));
|
|
400
|
-
|
|
407
|
+
compiler.hooks.done.tap("unplugin-https-reverse-proxy", (stats) => {
|
|
408
|
+
if (stats.hasErrors())
|
|
409
|
+
return;
|
|
410
|
+
console.log(` ${import_picocolors.default.green("\u279C")} ${import_picocolors.default.bold("run caddy reverse proxy success")}: ${colorUrl(`https://${target}`)}`);
|
|
411
|
+
});
|
|
401
412
|
import_node_process3.default.on("SIGINT", async () => {
|
|
402
413
|
await stop();
|
|
403
414
|
import_node_process3.default.exit();
|
|
404
415
|
});
|
|
416
|
+
}).catch((e) => {
|
|
417
|
+
throw e;
|
|
405
418
|
});
|
|
406
419
|
} catch (e) {
|
|
407
420
|
console.error(e);
|
package/dist/rollup.js
CHANGED
package/dist/vite.cjs
CHANGED
|
@@ -55,7 +55,7 @@ var import_kill_port = __toESM(require("kill-port"), 1);
|
|
|
55
55
|
var import_node_path = require("path");
|
|
56
56
|
var import_node_process = __toESM(require("process"), 1);
|
|
57
57
|
var TEMP_DIR = import_node_process.default.env.TEMP || import_node_process.default.env.TMPDIR || "/tmp";
|
|
58
|
-
var caddyPath = (0, import_node_path.join)(TEMP_DIR,
|
|
58
|
+
var caddyPath = (0, import_node_path.join)(TEMP_DIR, `caddy${import_node_process.default.platform === "win32" ? ".exe" : ""}`);
|
|
59
59
|
var caddyFilePath = (0, import_node_path.join)(TEMP_DIR, "CADDYFILE");
|
|
60
60
|
var supportList = [
|
|
61
61
|
{
|
|
@@ -228,7 +228,7 @@ function testCaddy() {
|
|
|
228
228
|
if (!(0, import_node_fs.existsSync)(caddyPath))
|
|
229
229
|
return resolve(false);
|
|
230
230
|
(0, import_node_fs.chmodSync)(caddyPath, 493);
|
|
231
|
-
const child = (0, import_node_child_process.spawn)("sudo", [caddyPath]);
|
|
231
|
+
const child = import_node_process2.default.platform === "win32" ? (0, import_node_child_process.spawn)(caddyPath, []) : (0, import_node_child_process.spawn)("sudo", [caddyPath]);
|
|
232
232
|
child.on("error", (err) => {
|
|
233
233
|
reject(err);
|
|
234
234
|
});
|
|
@@ -302,8 +302,9 @@ var CaddyInstant = class {
|
|
|
302
302
|
* @returns
|
|
303
303
|
*/
|
|
304
304
|
async run(source, target, options) {
|
|
305
|
+
source = source.replace("0.0.0.0", "127.0.0.1").replace("localhost", "127.0.0.1");
|
|
305
306
|
const {
|
|
306
|
-
restore =
|
|
307
|
+
restore = true,
|
|
307
308
|
base = "/"
|
|
308
309
|
} = options || {};
|
|
309
310
|
if (!this.inited)
|
|
@@ -312,8 +313,10 @@ var CaddyInstant = class {
|
|
|
312
313
|
throw new Error("update host failed");
|
|
313
314
|
if (await tryPort(443))
|
|
314
315
|
await (0, import_kill_port.default)(443, "tcp");
|
|
316
|
+
if (await tryPort(80))
|
|
317
|
+
await (0, import_kill_port.default)(80, "tcp");
|
|
315
318
|
return new Promise((resolve, reject) => {
|
|
316
|
-
const child = (0, import_node_child_process.spawn)("sudo", [caddyPath, "reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]);
|
|
319
|
+
const child = import_node_process2.default.platform !== "win32" ? (0, import_node_child_process.spawn)("sudo", [caddyPath, "reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]) : (0, import_node_child_process.spawn)(caddyPath, ["reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]);
|
|
317
320
|
child.on("error", (err) => {
|
|
318
321
|
return reject(err);
|
|
319
322
|
});
|
|
@@ -341,8 +344,10 @@ var CaddyInstant = class {
|
|
|
341
344
|
|
|
342
345
|
// src/index.ts
|
|
343
346
|
var config;
|
|
347
|
+
var caddy;
|
|
344
348
|
var unpluginFactory = (options) => ({
|
|
345
349
|
name: "unplugin-https-reverse-proxy",
|
|
350
|
+
enforce: "post",
|
|
346
351
|
vite: {
|
|
347
352
|
configResolved(_config) {
|
|
348
353
|
config = _config;
|
|
@@ -365,8 +370,8 @@ var unpluginFactory = (options) => ({
|
|
|
365
370
|
}
|
|
366
371
|
const base = server.config.base || "/";
|
|
367
372
|
try {
|
|
368
|
-
const
|
|
369
|
-
|
|
373
|
+
const caddy2 = new CaddyInstant();
|
|
374
|
+
caddy2.run(source, target, {
|
|
370
375
|
base
|
|
371
376
|
}).then((stop) => {
|
|
372
377
|
const colorUrl = (url2) => import_picocolors.default.green(url2.replace(/:(\d+)\//, (_, port) => `:${import_picocolors.default.bold(port)}/`));
|
|
@@ -384,7 +389,6 @@ var unpluginFactory = (options) => ({
|
|
|
384
389
|
}
|
|
385
390
|
},
|
|
386
391
|
webpack(compiler) {
|
|
387
|
-
var _a, _b;
|
|
388
392
|
const {
|
|
389
393
|
target = ""
|
|
390
394
|
} = options;
|
|
@@ -392,16 +396,25 @@ var unpluginFactory = (options) => ({
|
|
|
392
396
|
console.log("please provide target");
|
|
393
397
|
return;
|
|
394
398
|
}
|
|
395
|
-
const source = `${((_a = compiler.options.devServer) == null ? void 0 : _a.host) || "127.0.0.1"}:${((_b = compiler.options.devServer) == null ? void 0 : _b.port) || "8080"}`;
|
|
396
399
|
try {
|
|
397
|
-
const
|
|
400
|
+
const devServer = compiler.options.devServer || import_node_process3.default.VUE_CLI_SERVICE.projectOptions.devServer;
|
|
401
|
+
const source = `${(devServer == null ? void 0 : devServer.host) || "127.0.0.1"}:${(devServer == null ? void 0 : devServer.port) || "8080"}`;
|
|
402
|
+
if (caddy)
|
|
403
|
+
return;
|
|
404
|
+
caddy = new CaddyInstant();
|
|
398
405
|
caddy.run(source, target).then((stop) => {
|
|
399
406
|
const colorUrl = (url) => import_picocolors.default.green(url.replace(/:(\d+)\//, (_, port) => `:${import_picocolors.default.bold(port)}/`));
|
|
400
|
-
|
|
407
|
+
compiler.hooks.done.tap("unplugin-https-reverse-proxy", (stats) => {
|
|
408
|
+
if (stats.hasErrors())
|
|
409
|
+
return;
|
|
410
|
+
console.log(` ${import_picocolors.default.green("\u279C")} ${import_picocolors.default.bold("run caddy reverse proxy success")}: ${colorUrl(`https://${target}`)}`);
|
|
411
|
+
});
|
|
401
412
|
import_node_process3.default.on("SIGINT", async () => {
|
|
402
413
|
await stop();
|
|
403
414
|
import_node_process3.default.exit();
|
|
404
415
|
});
|
|
416
|
+
}).catch((e) => {
|
|
417
|
+
throw e;
|
|
405
418
|
});
|
|
406
419
|
} catch (e) {
|
|
407
420
|
console.error(e);
|
package/dist/vite.js
CHANGED
package/dist/webpack.cjs
CHANGED
|
@@ -55,7 +55,7 @@ var import_kill_port = __toESM(require("kill-port"), 1);
|
|
|
55
55
|
var import_node_path = require("path");
|
|
56
56
|
var import_node_process = __toESM(require("process"), 1);
|
|
57
57
|
var TEMP_DIR = import_node_process.default.env.TEMP || import_node_process.default.env.TMPDIR || "/tmp";
|
|
58
|
-
var caddyPath = (0, import_node_path.join)(TEMP_DIR,
|
|
58
|
+
var caddyPath = (0, import_node_path.join)(TEMP_DIR, `caddy${import_node_process.default.platform === "win32" ? ".exe" : ""}`);
|
|
59
59
|
var caddyFilePath = (0, import_node_path.join)(TEMP_DIR, "CADDYFILE");
|
|
60
60
|
var supportList = [
|
|
61
61
|
{
|
|
@@ -228,7 +228,7 @@ function testCaddy() {
|
|
|
228
228
|
if (!(0, import_node_fs.existsSync)(caddyPath))
|
|
229
229
|
return resolve(false);
|
|
230
230
|
(0, import_node_fs.chmodSync)(caddyPath, 493);
|
|
231
|
-
const child = (0, import_node_child_process.spawn)("sudo", [caddyPath]);
|
|
231
|
+
const child = import_node_process2.default.platform === "win32" ? (0, import_node_child_process.spawn)(caddyPath, []) : (0, import_node_child_process.spawn)("sudo", [caddyPath]);
|
|
232
232
|
child.on("error", (err) => {
|
|
233
233
|
reject(err);
|
|
234
234
|
});
|
|
@@ -302,8 +302,9 @@ var CaddyInstant = class {
|
|
|
302
302
|
* @returns
|
|
303
303
|
*/
|
|
304
304
|
async run(source, target, options) {
|
|
305
|
+
source = source.replace("0.0.0.0", "127.0.0.1").replace("localhost", "127.0.0.1");
|
|
305
306
|
const {
|
|
306
|
-
restore =
|
|
307
|
+
restore = true,
|
|
307
308
|
base = "/"
|
|
308
309
|
} = options || {};
|
|
309
310
|
if (!this.inited)
|
|
@@ -312,8 +313,10 @@ var CaddyInstant = class {
|
|
|
312
313
|
throw new Error("update host failed");
|
|
313
314
|
if (await tryPort(443))
|
|
314
315
|
await (0, import_kill_port.default)(443, "tcp");
|
|
316
|
+
if (await tryPort(80))
|
|
317
|
+
await (0, import_kill_port.default)(80, "tcp");
|
|
315
318
|
return new Promise((resolve, reject) => {
|
|
316
|
-
const child = (0, import_node_child_process.spawn)("sudo", [caddyPath, "reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]);
|
|
319
|
+
const child = import_node_process2.default.platform !== "win32" ? (0, import_node_child_process.spawn)("sudo", [caddyPath, "reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]) : (0, import_node_child_process.spawn)(caddyPath, ["reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]);
|
|
317
320
|
child.on("error", (err) => {
|
|
318
321
|
return reject(err);
|
|
319
322
|
});
|
|
@@ -341,8 +344,10 @@ var CaddyInstant = class {
|
|
|
341
344
|
|
|
342
345
|
// src/index.ts
|
|
343
346
|
var config;
|
|
347
|
+
var caddy;
|
|
344
348
|
var unpluginFactory = (options) => ({
|
|
345
349
|
name: "unplugin-https-reverse-proxy",
|
|
350
|
+
enforce: "post",
|
|
346
351
|
vite: {
|
|
347
352
|
configResolved(_config) {
|
|
348
353
|
config = _config;
|
|
@@ -365,8 +370,8 @@ var unpluginFactory = (options) => ({
|
|
|
365
370
|
}
|
|
366
371
|
const base = server.config.base || "/";
|
|
367
372
|
try {
|
|
368
|
-
const
|
|
369
|
-
|
|
373
|
+
const caddy2 = new CaddyInstant();
|
|
374
|
+
caddy2.run(source, target, {
|
|
370
375
|
base
|
|
371
376
|
}).then((stop) => {
|
|
372
377
|
const colorUrl = (url2) => import_picocolors.default.green(url2.replace(/:(\d+)\//, (_, port) => `:${import_picocolors.default.bold(port)}/`));
|
|
@@ -384,7 +389,6 @@ var unpluginFactory = (options) => ({
|
|
|
384
389
|
}
|
|
385
390
|
},
|
|
386
391
|
webpack(compiler) {
|
|
387
|
-
var _a, _b;
|
|
388
392
|
const {
|
|
389
393
|
target = ""
|
|
390
394
|
} = options;
|
|
@@ -392,16 +396,25 @@ var unpluginFactory = (options) => ({
|
|
|
392
396
|
console.log("please provide target");
|
|
393
397
|
return;
|
|
394
398
|
}
|
|
395
|
-
const source = `${((_a = compiler.options.devServer) == null ? void 0 : _a.host) || "127.0.0.1"}:${((_b = compiler.options.devServer) == null ? void 0 : _b.port) || "8080"}`;
|
|
396
399
|
try {
|
|
397
|
-
const
|
|
400
|
+
const devServer = compiler.options.devServer || import_node_process3.default.VUE_CLI_SERVICE.projectOptions.devServer;
|
|
401
|
+
const source = `${(devServer == null ? void 0 : devServer.host) || "127.0.0.1"}:${(devServer == null ? void 0 : devServer.port) || "8080"}`;
|
|
402
|
+
if (caddy)
|
|
403
|
+
return;
|
|
404
|
+
caddy = new CaddyInstant();
|
|
398
405
|
caddy.run(source, target).then((stop) => {
|
|
399
406
|
const colorUrl = (url) => import_picocolors.default.green(url.replace(/:(\d+)\//, (_, port) => `:${import_picocolors.default.bold(port)}/`));
|
|
400
|
-
|
|
407
|
+
compiler.hooks.done.tap("unplugin-https-reverse-proxy", (stats) => {
|
|
408
|
+
if (stats.hasErrors())
|
|
409
|
+
return;
|
|
410
|
+
console.log(` ${import_picocolors.default.green("\u279C")} ${import_picocolors.default.bold("run caddy reverse proxy success")}: ${colorUrl(`https://${target}`)}`);
|
|
411
|
+
});
|
|
401
412
|
import_node_process3.default.on("SIGINT", async () => {
|
|
402
413
|
await stop();
|
|
403
414
|
import_node_process3.default.exit();
|
|
404
415
|
});
|
|
416
|
+
}).catch((e) => {
|
|
417
|
+
throw e;
|
|
405
418
|
});
|
|
406
419
|
} catch (e) {
|
|
407
420
|
console.error(e);
|
package/dist/webpack.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unplugin-https-reverse-proxy",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.3",
|
|
5
5
|
"packageManager": "pnpm@8.6.12",
|
|
6
6
|
"description": "",
|
|
7
7
|
"license": "MIT",
|
|
@@ -101,6 +101,7 @@
|
|
|
101
101
|
}
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
|
+
"esno": "^0.17.0",
|
|
104
105
|
"got-cjs": "^12.5.4",
|
|
105
106
|
"hostile": "^1.3.3",
|
|
106
107
|
"http-proxy-agent": "^7.0.0",
|
|
@@ -119,7 +120,6 @@
|
|
|
119
120
|
"bumpp": "^9.2.0",
|
|
120
121
|
"chalk": "^5.3.0",
|
|
121
122
|
"eslint": "^8.47.0",
|
|
122
|
-
"esno": "^0.17.0",
|
|
123
123
|
"fast-glob": "^3.3.1",
|
|
124
124
|
"nodemon": "^3.0.1",
|
|
125
125
|
"rimraf": "^5.0.1",
|