This repository was archived by the owner on Nov 22, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-11
lines changed
modules/builders/src/ssr-dev-server Expand file tree Collapse file tree 1 file changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -348,19 +348,26 @@ function getProxyConfig(root: string, proxyConfig: string): browserSync.Middlewa
348348 }
349349
350350 const proxies = Array . isArray ( proxySettings ) ? proxySettings : [ proxySettings ] ;
351-
352- return proxies . map ( ( proxy ) => {
353- const keys = Object . keys ( proxy ) ;
354- const context = keys [ 0 ] ;
355-
356- if ( keys . length === 1 || typeof context === 'string' ) {
357- const normalizedContext = context . replace ( / ^ \* $ / , '**' ) . replace ( / \/ \* $ / , '' ) ;
358-
359- return createProxyMiddleware ( normalizedContext , proxy [ context ] ) as any ;
351+ const createdProxies = [ ] ;
352+
353+ for ( const proxy of proxies ) {
354+ for ( const [ key , context ] of Object . entries ( proxy ) ) {
355+ if ( typeof key === 'string' ) {
356+ createdProxies . push (
357+ createProxyMiddleware (
358+ key . replace ( / ^ \* $ / , '**' ) . replace ( / \/ \* $ / , '' ) ,
359+ context as any ,
360+ ) as browserSync . MiddlewareHandler ,
361+ ) ;
362+ } else {
363+ createdProxies . push (
364+ createProxyMiddleware ( key , context as any ) as browserSync . MiddlewareHandler ,
365+ ) ;
366+ }
360367 }
368+ }
361369
362- return createProxyMiddleware ( proxy ) as any ;
363- } ) ;
370+ return createdProxies ;
364371}
365372
366373export default createBuilder < SSRDevServerBuilderOptions , BuilderOutput > ( execute ) ;
You can’t perform that action at this time.
0 commit comments