File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ UHRP_AUTO_INSTALL_CADDY=true npm i unplugin-https-reverse-proxy --save-dev
1616
1717``` ts
1818interface Options {
19+ enable? : boolean // <- default: true
1920 target: string // <- https target hostname
2021 showCaddyLog? : boolean // <- default: false
2122}
@@ -26,11 +27,11 @@ interface Options {
2627
2728``` ts
2829// vite.config.ts
29- import Starter from ' unplugin-https-reverse-proxy/vite'
30+ import HttpsReverseProxy from ' unplugin-https-reverse-proxy/vite'
3031
3132export default defineConfig ({
3233 plugins: [
33- Starter ({ /* options */ }),
34+ HttpsReverseProxy ({ /* options */ }),
3435 ],
3536})
3637```
Original file line number Diff line number Diff line change @@ -20,8 +20,11 @@ export const unpluginFactory: UnpluginFactory<Options> = options => ({
2020 } ,
2121 configureServer ( server ) {
2222 const {
23+ enable = true ,
2324 target = '' ,
2425 } = options
26+ if ( ! enable )
27+ return
2528 if ( ! target ) {
2629 consola . fail ( 'please provide target' )
2730 return
@@ -62,8 +65,11 @@ export const unpluginFactory: UnpluginFactory<Options> = options => ({
6265 } ,
6366 webpack ( compiler ) {
6467 const {
68+ enable = true ,
6569 target = '' ,
6670 } = options
71+ if ( ! enable )
72+ return
6773 if ( ! target ) {
6874 consola . fail ( 'please provide target' )
6975 return
Original file line number Diff line number Diff line change 11export interface Options {
22 // define your plugin options here
3+ enable ?: boolean
34 target : string
45 showCaddyLog ?: boolean
56}
You can’t perform that action at this time.
0 commit comments