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 +5 -1
- package/package.json +1 -1
- package/scripts/postinstall.ts +5 -2
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
|
-
|
|
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
package/scripts/postinstall.ts
CHANGED
|
@@ -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
|
-
|
|
9
|
-
|
|
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)
|