unplugin-https-reverse-proxy 0.0.13 → 0.0.15

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 CHANGED
@@ -57,6 +57,7 @@ module.exports = {
57
57
  },
58
58
  },
59
59
  setupExitSignals: true,
60
+ allowedHosts: 'all',
60
61
  },
61
62
  plugins: [
62
63
  require('unplugin-https-reverse-proxy/webpack')({ /* options */ })
@@ -98,6 +99,7 @@ module.exports = {
98
99
  },
99
100
  },
100
101
  setupExitSignals: true,
102
+ allowedHosts: 'all',
101
103
  },
102
104
  configureWebpack: {
103
105
  plugins: [
@@ -125,4 +127,4 @@ If your broswer shows a not trusted certificate warning, please check the keycha
125
127
 
126
128
  ![keychain](https://github.com/zcf0508/unplugin-https-reverse-proxy/blob/main/images/Snipaste_2023-11-16_16-59-55.png)
127
129
 
128
- More info, you can check [caddy about CA Root](https://caddyserver.com/docs/automatic-https#ca-root).
130
+ More info, you can check [caddy about CA Root](https://caddyserver.com/docs/automatic-https#ca-root).
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-DH6VMKTP.js";
3
+ } from "./chunk-EI2YSLDH.js";
4
4
 
5
5
  // src/vite.ts
6
6
  import { createVitePlugin } from "unplugin";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-DH6VMKTP.js";
3
+ } from "./chunk-EI2YSLDH.js";
4
4
 
5
5
  // src/webpack.ts
6
6
  import { createWebpackPlugin } from "unplugin";
@@ -402,10 +402,12 @@ var unpluginFactory = (options) => ({
402
402
  registerExit(async () => {
403
403
  var _a;
404
404
  try {
405
- _servce && _servce.close();
406
- (_a = _servce.httpServer) == null ? void 0 : _a.close(async () => {
407
- _stop && await _stop();
408
- });
405
+ if (_servce) {
406
+ (_a = _servce.httpServer) == null ? void 0 : _a.close(async () => {
407
+ _stop && await _stop();
408
+ });
409
+ _servce.close();
410
+ }
409
411
  _stop && await _stop();
410
412
  } catch (e) {
411
413
  consola.error(e);
@@ -413,6 +415,8 @@ var unpluginFactory = (options) => ({
413
415
  });
414
416
  },
415
417
  configureServer(server) {
418
+ if (config.command === "build")
419
+ return;
416
420
  const {
417
421
  enable = true,
418
422
  target = ""
@@ -453,9 +457,6 @@ var unpluginFactory = (options) => ({
453
457
  consola.error(e);
454
458
  }
455
459
  };
456
- },
457
- async buildEnd() {
458
- _stop && await _stop();
459
460
  }
460
461
  },
461
462
  webpack(compiler) {
@@ -470,13 +471,6 @@ var unpluginFactory = (options) => ({
470
471
  return;
471
472
  }
472
473
  try {
473
- registerExit(async () => {
474
- try {
475
- _stop && await _stop();
476
- } catch (e) {
477
- consola.error(e);
478
- }
479
- });
480
474
  const devServer = __spreadValues(__spreadValues({
481
475
  host: "127.0.0.1",
482
476
  port: 8080
package/dist/esbuild.cjs CHANGED
@@ -462,10 +462,12 @@ var unpluginFactory = (options) => ({
462
462
  registerExit(async () => {
463
463
  var _a;
464
464
  try {
465
- _servce && _servce.close();
466
- (_a = _servce.httpServer) == null ? void 0 : _a.close(async () => {
467
- _stop && await _stop();
468
- });
465
+ if (_servce) {
466
+ (_a = _servce.httpServer) == null ? void 0 : _a.close(async () => {
467
+ _stop && await _stop();
468
+ });
469
+ _servce.close();
470
+ }
469
471
  _stop && await _stop();
470
472
  } catch (e) {
471
473
  consola.error(e);
@@ -473,6 +475,8 @@ var unpluginFactory = (options) => ({
473
475
  });
474
476
  },
475
477
  configureServer(server) {
478
+ if (config.command === "build")
479
+ return;
476
480
  const {
477
481
  enable = true,
478
482
  target = ""
@@ -513,9 +517,6 @@ var unpluginFactory = (options) => ({
513
517
  consola.error(e);
514
518
  }
515
519
  };
516
- },
517
- async buildEnd() {
518
- _stop && await _stop();
519
520
  }
520
521
  },
521
522
  webpack(compiler) {
@@ -530,13 +531,6 @@ var unpluginFactory = (options) => ({
530
531
  return;
531
532
  }
532
533
  try {
533
- registerExit(async () => {
534
- try {
535
- _stop && await _stop();
536
- } catch (e) {
537
- consola.error(e);
538
- }
539
- });
540
534
  const devServer = __spreadValues(__spreadValues({
541
535
  host: "127.0.0.1",
542
536
  port: 8080
package/dist/esbuild.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-DH6VMKTP.js";
3
+ } from "./chunk-EI2YSLDH.js";
4
4
  import "./chunk-CQC5SSJR.js";
5
5
 
6
6
  // src/esbuild.ts
package/dist/index.cjs CHANGED
@@ -461,10 +461,12 @@ var unpluginFactory = (options) => ({
461
461
  registerExit(async () => {
462
462
  var _a;
463
463
  try {
464
- _servce && _servce.close();
465
- (_a = _servce.httpServer) == null ? void 0 : _a.close(async () => {
466
- _stop && await _stop();
467
- });
464
+ if (_servce) {
465
+ (_a = _servce.httpServer) == null ? void 0 : _a.close(async () => {
466
+ _stop && await _stop();
467
+ });
468
+ _servce.close();
469
+ }
468
470
  _stop && await _stop();
469
471
  } catch (e) {
470
472
  consola.error(e);
@@ -472,6 +474,8 @@ var unpluginFactory = (options) => ({
472
474
  });
473
475
  },
474
476
  configureServer(server) {
477
+ if (config.command === "build")
478
+ return;
475
479
  const {
476
480
  enable = true,
477
481
  target = ""
@@ -512,9 +516,6 @@ var unpluginFactory = (options) => ({
512
516
  consola.error(e);
513
517
  }
514
518
  };
515
- },
516
- async buildEnd() {
517
- _stop && await _stop();
518
519
  }
519
520
  },
520
521
  webpack(compiler) {
@@ -529,13 +530,6 @@ var unpluginFactory = (options) => ({
529
530
  return;
530
531
  }
531
532
  try {
532
- registerExit(async () => {
533
- try {
534
- _stop && await _stop();
535
- } catch (e) {
536
- consola.error(e);
537
- }
538
- });
539
533
  const devServer = __spreadValues(__spreadValues({
540
534
  host: "127.0.0.1",
541
535
  port: 8080
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  src_default,
3
3
  unplugin,
4
4
  unpluginFactory
5
- } from "./chunk-DH6VMKTP.js";
5
+ } from "./chunk-EI2YSLDH.js";
6
6
  import "./chunk-CQC5SSJR.js";
7
7
  export {
8
8
  src_default as default,
package/dist/nuxt.cjs CHANGED
@@ -465,10 +465,12 @@ var unpluginFactory = (options) => ({
465
465
  registerExit(async () => {
466
466
  var _a;
467
467
  try {
468
- _servce && _servce.close();
469
- (_a = _servce.httpServer) == null ? void 0 : _a.close(async () => {
470
- _stop && await _stop();
471
- });
468
+ if (_servce) {
469
+ (_a = _servce.httpServer) == null ? void 0 : _a.close(async () => {
470
+ _stop && await _stop();
471
+ });
472
+ _servce.close();
473
+ }
472
474
  _stop && await _stop();
473
475
  } catch (e) {
474
476
  consola.error(e);
@@ -476,6 +478,8 @@ var unpluginFactory = (options) => ({
476
478
  });
477
479
  },
478
480
  configureServer(server) {
481
+ if (config.command === "build")
482
+ return;
479
483
  const {
480
484
  enable = true,
481
485
  target = ""
@@ -516,9 +520,6 @@ var unpluginFactory = (options) => ({
516
520
  consola.error(e);
517
521
  }
518
522
  };
519
- },
520
- async buildEnd() {
521
- _stop && await _stop();
522
523
  }
523
524
  },
524
525
  webpack(compiler) {
@@ -533,13 +534,6 @@ var unpluginFactory = (options) => ({
533
534
  return;
534
535
  }
535
536
  try {
536
- registerExit(async () => {
537
- try {
538
- _stop && await _stop();
539
- } catch (e) {
540
- consola.error(e);
541
- }
542
- });
543
537
  const devServer = __spreadValues(__spreadValues({
544
538
  host: "127.0.0.1",
545
539
  port: 8080
package/dist/nuxt.d.cts CHANGED
@@ -5,4 +5,4 @@ interface ModuleOptions extends Options {
5
5
  }
6
6
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
7
7
 
8
- export { ModuleOptions, _default as default };
8
+ export { type ModuleOptions, _default as default };
package/dist/nuxt.d.ts CHANGED
@@ -5,4 +5,4 @@ interface ModuleOptions extends Options {
5
5
  }
6
6
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
7
7
 
8
- export { ModuleOptions, _default as default };
8
+ export { type ModuleOptions, _default as default };
package/dist/nuxt.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  vite_default
3
- } from "./chunk-6KXUNICB.js";
3
+ } from "./chunk-6MTK7ADW.js";
4
4
  import {
5
5
  webpack_default
6
- } from "./chunk-RTEXFW4L.js";
7
- import "./chunk-DH6VMKTP.js";
6
+ } from "./chunk-EDUM4QD7.js";
7
+ import "./chunk-EI2YSLDH.js";
8
8
  import "./chunk-CQC5SSJR.js";
9
9
 
10
10
  // src/nuxt.ts
package/dist/rollup.cjs CHANGED
@@ -462,10 +462,12 @@ var unpluginFactory = (options) => ({
462
462
  registerExit(async () => {
463
463
  var _a;
464
464
  try {
465
- _servce && _servce.close();
466
- (_a = _servce.httpServer) == null ? void 0 : _a.close(async () => {
467
- _stop && await _stop();
468
- });
465
+ if (_servce) {
466
+ (_a = _servce.httpServer) == null ? void 0 : _a.close(async () => {
467
+ _stop && await _stop();
468
+ });
469
+ _servce.close();
470
+ }
469
471
  _stop && await _stop();
470
472
  } catch (e) {
471
473
  consola.error(e);
@@ -473,6 +475,8 @@ var unpluginFactory = (options) => ({
473
475
  });
474
476
  },
475
477
  configureServer(server) {
478
+ if (config.command === "build")
479
+ return;
476
480
  const {
477
481
  enable = true,
478
482
  target = ""
@@ -513,9 +517,6 @@ var unpluginFactory = (options) => ({
513
517
  consola.error(e);
514
518
  }
515
519
  };
516
- },
517
- async buildEnd() {
518
- _stop && await _stop();
519
520
  }
520
521
  },
521
522
  webpack(compiler) {
@@ -530,13 +531,6 @@ var unpluginFactory = (options) => ({
530
531
  return;
531
532
  }
532
533
  try {
533
- registerExit(async () => {
534
- try {
535
- _stop && await _stop();
536
- } catch (e) {
537
- consola.error(e);
538
- }
539
- });
540
534
  const devServer = __spreadValues(__spreadValues({
541
535
  host: "127.0.0.1",
542
536
  port: 8080
package/dist/rollup.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as rollup from 'rollup';
2
2
  import { Options } from './types.cjs';
3
3
 
4
- declare const _default: (options: Options) => rollup.Plugin | rollup.Plugin[];
4
+ declare const _default: (options: Options) => rollup.Plugin<any> | rollup.Plugin<any>[];
5
5
 
6
6
  export { _default as default };
package/dist/rollup.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as rollup from 'rollup';
2
2
  import { Options } from './types.js';
3
3
 
4
- declare const _default: (options: Options) => rollup.Plugin | rollup.Plugin[];
4
+ declare const _default: (options: Options) => rollup.Plugin<any> | rollup.Plugin<any>[];
5
5
 
6
6
  export { _default as default };
package/dist/rollup.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-DH6VMKTP.js";
3
+ } from "./chunk-EI2YSLDH.js";
4
4
  import "./chunk-CQC5SSJR.js";
5
5
 
6
6
  // src/rollup.ts
package/dist/types.d.cts CHANGED
@@ -4,4 +4,4 @@ interface Options {
4
4
  showCaddyLog?: boolean;
5
5
  }
6
6
 
7
- export { Options };
7
+ export type { Options };
package/dist/types.d.ts CHANGED
@@ -4,4 +4,4 @@ interface Options {
4
4
  showCaddyLog?: boolean;
5
5
  }
6
6
 
7
- export { Options };
7
+ export type { Options };
package/dist/vite.cjs CHANGED
@@ -462,10 +462,12 @@ var unpluginFactory = (options) => ({
462
462
  registerExit(async () => {
463
463
  var _a;
464
464
  try {
465
- _servce && _servce.close();
466
- (_a = _servce.httpServer) == null ? void 0 : _a.close(async () => {
467
- _stop && await _stop();
468
- });
465
+ if (_servce) {
466
+ (_a = _servce.httpServer) == null ? void 0 : _a.close(async () => {
467
+ _stop && await _stop();
468
+ });
469
+ _servce.close();
470
+ }
469
471
  _stop && await _stop();
470
472
  } catch (e) {
471
473
  consola.error(e);
@@ -473,6 +475,8 @@ var unpluginFactory = (options) => ({
473
475
  });
474
476
  },
475
477
  configureServer(server) {
478
+ if (config.command === "build")
479
+ return;
476
480
  const {
477
481
  enable = true,
478
482
  target = ""
@@ -513,9 +517,6 @@ var unpluginFactory = (options) => ({
513
517
  consola.error(e);
514
518
  }
515
519
  };
516
- },
517
- async buildEnd() {
518
- _stop && await _stop();
519
520
  }
520
521
  },
521
522
  webpack(compiler) {
@@ -530,13 +531,6 @@ var unpluginFactory = (options) => ({
530
531
  return;
531
532
  }
532
533
  try {
533
- registerExit(async () => {
534
- try {
535
- _stop && await _stop();
536
- } catch (e) {
537
- consola.error(e);
538
- }
539
- });
540
534
  const devServer = __spreadValues(__spreadValues({
541
535
  host: "127.0.0.1",
542
536
  port: 8080
package/dist/vite.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  vite_default
3
- } from "./chunk-6KXUNICB.js";
4
- import "./chunk-DH6VMKTP.js";
3
+ } from "./chunk-6MTK7ADW.js";
4
+ import "./chunk-EI2YSLDH.js";
5
5
  import "./chunk-CQC5SSJR.js";
6
6
  export {
7
7
  vite_default as default
package/dist/webpack.cjs CHANGED
@@ -462,10 +462,12 @@ var unpluginFactory = (options) => ({
462
462
  registerExit(async () => {
463
463
  var _a;
464
464
  try {
465
- _servce && _servce.close();
466
- (_a = _servce.httpServer) == null ? void 0 : _a.close(async () => {
467
- _stop && await _stop();
468
- });
465
+ if (_servce) {
466
+ (_a = _servce.httpServer) == null ? void 0 : _a.close(async () => {
467
+ _stop && await _stop();
468
+ });
469
+ _servce.close();
470
+ }
469
471
  _stop && await _stop();
470
472
  } catch (e) {
471
473
  consola.error(e);
@@ -473,6 +475,8 @@ var unpluginFactory = (options) => ({
473
475
  });
474
476
  },
475
477
  configureServer(server) {
478
+ if (config.command === "build")
479
+ return;
476
480
  const {
477
481
  enable = true,
478
482
  target = ""
@@ -513,9 +517,6 @@ var unpluginFactory = (options) => ({
513
517
  consola.error(e);
514
518
  }
515
519
  };
516
- },
517
- async buildEnd() {
518
- _stop && await _stop();
519
520
  }
520
521
  },
521
522
  webpack(compiler) {
@@ -530,13 +531,6 @@ var unpluginFactory = (options) => ({
530
531
  return;
531
532
  }
532
533
  try {
533
- registerExit(async () => {
534
- try {
535
- _stop && await _stop();
536
- } catch (e) {
537
- consola.error(e);
538
- }
539
- });
540
534
  const devServer = __spreadValues(__spreadValues({
541
535
  host: "127.0.0.1",
542
536
  port: 8080
package/dist/webpack.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  webpack_default
3
- } from "./chunk-RTEXFW4L.js";
4
- import "./chunk-DH6VMKTP.js";
3
+ } from "./chunk-EDUM4QD7.js";
4
+ import "./chunk-EI2YSLDH.js";
5
5
  import "./chunk-CQC5SSJR.js";
6
6
  export {
7
7
  webpack_default as default
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.13",
4
+ "version": "0.0.15",
5
5
  "packageManager": "pnpm@8.6.12",
6
6
  "description": "",
7
7
  "license": "MIT",
@@ -120,6 +120,7 @@
120
120
  "@nuxt/schema": "^3.6.5",
121
121
  "@types/kill-port": "^2.0.3",
122
122
  "@types/node": "^20.5.2",
123
+ "@vue/cli": "^5.0.8",
123
124
  "bumpp": "^9.2.0",
124
125
  "chalk": "^5.3.0",
125
126
  "eslint": "^8.47.0",
@@ -139,7 +140,8 @@
139
140
  "dev": "tsup --watch src",
140
141
  "build:fix": "esno scripts/postbuild.ts",
141
142
  "lint": "eslint .",
142
- "play": "npm -C playground run dev",
143
+ "play": "npm -C examples/vite run dev",
144
+ "play:vuecli": "npm -C examples/vuecli run serve",
143
145
  "release": "bumpp",
144
146
  "start": "esno src/index.ts",
145
147
  "test": "vitest"
package/src/index.ts CHANGED
@@ -54,10 +54,12 @@ export const unpluginFactory: UnpluginFactory<Options> = options => ({
54
54
  config = _config
55
55
  registerExit(async () => {
56
56
  try {
57
- _servce && _servce.close()
58
- _servce.httpServer?.close(async () => {
59
- _stop && await _stop()
60
- })
57
+ if (_servce) {
58
+ _servce.httpServer?.close(async () => {
59
+ _stop && await _stop()
60
+ })
61
+ _servce.close()
62
+ }
61
63
  _stop && await _stop()
62
64
  }
63
65
  catch (e) {
@@ -66,6 +68,9 @@ export const unpluginFactory: UnpluginFactory<Options> = options => ({
66
68
  })
67
69
  },
68
70
  configureServer(server) {
71
+ if (config.command === 'build')
72
+ return
73
+
69
74
  const {
70
75
  enable = true,
71
76
  target = '',
@@ -109,10 +114,6 @@ export const unpluginFactory: UnpluginFactory<Options> = options => ({
109
114
  }
110
115
  }
111
116
  },
112
- async buildEnd() {
113
- // https://github.com/vitejs/vite/commit/4338d7d6f32c8e0e67ff58f0cb8c1a9120294756#diff-c0b6eb176448702b6325d2e1b2567c5ccf969f03eef1242950e0bfb18877022fR580
114
- _stop && await _stop()
115
- },
116
117
  },
117
118
  webpack(compiler) {
118
119
  const {
@@ -127,14 +128,14 @@ export const unpluginFactory: UnpluginFactory<Options> = options => ({
127
128
  }
128
129
 
129
130
  try {
130
- registerExit(async () => {
131
- try {
132
- _stop && await _stop()
133
- }
134
- catch (e) {
135
- consola.error(e)
136
- }
137
- })
131
+ // registerExit(async () => {
132
+ // try {
133
+ // _stop && await _stop()
134
+ // }
135
+ // catch (e) {
136
+ // consola.error(e)
137
+ // }
138
+ // })
138
139
 
139
140
  const devServer = {
140
141
  host: '127.0.0.1',