You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// TODO improve me after drop `bypass` to always generate error when configuration is bad
1942
-
if(!proxyConfig.bypass){
1943
-
util.deprecate(
1944
-
()=>{},
1945
-
`Invalid proxy configuration:\n\n${JSON.stringify(proxyConfig,null,2)}\n\nThe use of proxy object notation as proxy routes has been removed.\nPlease use the 'router' or 'context' options. Read more at https://github.com/chimurai/http-proxy-middleware/tree/v2.0.6#http-proxy-middleware-options`,
1946
-
'DEP_WEBPACK_DEV_SERVER_PROXY_ROUTES_ARGUMENT',
1947
-
)();
1904
+
if(proxyOptions.target||proxyOptions.router){
1905
+
returncreateProxyMiddleware(proxyOptions);
1948
1906
}
1907
+
1908
+
util.deprecate(
1909
+
()=>{},
1910
+
`Invalid proxy configuration:\n\n${JSON.stringify(proxyConfig,null,2)}\n\nThe use of proxy object notation as proxy routes has been removed.\nPlease use the 'router' or 'context' options. Read more at https://github.com/chimurai/http-proxy-middleware`,
1911
+
'DEP_WEBPACK_DEV_SERVER_PROXY_ROUTES_ARGUMENT',
1912
+
)();
1949
1913
};
1950
1914
1951
1915
/**
@@ -2001,36 +1965,11 @@ class Server<
2001
1965
}
2002
1966
}
2003
1967
2004
-
// - Check if we have a bypass function defined
2005
-
// - In case the bypass function is defined we'll retrieve the
2006
-
// bypassUrl from it otherwise bypassUrl would be null
2007
-
// TODO remove in the next major in favor `context` and `router` options
"Using the 'bypass' option is deprecated. Please use the 'router' or 'context' options. Read more at https://github.com/chimurai/http-proxy-middleware/tree/v2.0.6#http-proxy-middleware-options",
0 commit comments