File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 1
1
import { fileURLToPath } from 'url'
2
+ import { defu } from 'defu'
2
3
import { addServerHandler , defineNuxtModule } from '@nuxt/kit'
3
4
import { resolve } from 'pathe'
4
5
import type { Options } from 'http-proxy-middleware'
@@ -20,7 +21,9 @@ export default defineNuxtModule<ModuleOptions>({
20
21
const runtimeDir = fileURLToPath ( new URL ( './runtime' , import . meta. url ) )
21
22
nuxt . options . build . transpile . push ( runtimeDir , '#proxy-handler' )
22
23
23
- const finalConfig = ( nuxt . options . runtimeConfig . proxy = nuxt . options . runtimeConfig . proxy || { options : options . options } ) as ModuleOptions
24
+ const finalConfig = nuxt . options . runtimeConfig . proxy = defu ( nuxt . options . runtimeConfig . proxy , {
25
+ options : options . options ,
26
+ } )
24
27
25
28
function createProxyMiddleware ( options : Options , index ?: number ) {
26
29
return `
You can’t perform that action at this time.
0 commit comments