unplugin-https-reverse-proxy 0.0.8 → 0.0.9

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
@@ -7,7 +7,11 @@ A plugin for https reverse proxy, support `vite` and `webpack`.
7
7
  ## Install
8
8
 
9
9
  ```bash
10
- npm i unplugin-https-reverse-proxy
10
+ # not auto install caddy when postinstall
11
+ npm i unplugin-https-reverse-proxy --save-dev
12
+
13
+ # auto install
14
+ UHRP_AUTO_INSTALL_CADDY=true npm i unplugin-https-reverse-proxy --save-dev
11
15
  ```
12
16
 
13
17
  ```ts
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.8",
4
+ "version": "0.0.9",
5
5
  "packageManager": "pnpm@8.6.12",
6
6
  "description": "",
7
7
  "license": "MIT",
@@ -1,12 +1,15 @@
1
1
  import { existsSync, unlinkSync } from 'node:fs'
2
+ import process from 'node:process'
2
3
  import { consola } from '../src/utils'
3
4
  import { download } from '../src/caddy'
4
5
  import { caddyPath } from '../src/caddy/constants'
5
6
 
6
7
  async function run() {
7
8
  try {
8
- existsSync(caddyPath) && unlinkSync(caddyPath)
9
- await download()
9
+ if (process.env.UHRP_AUTO_INSTALL_CADDY) {
10
+ existsSync(caddyPath) && unlinkSync(caddyPath)
11
+ await download()
12
+ }
10
13
  }
11
14
  catch (e: any) {
12
15
  consola.error(e.code)