From b2a3c2db3a5ad6e142a48beb91cb15948b36d084 Mon Sep 17 00:00:00 2001 From: Martin Marosi Date: Tue, 1 Oct 2024 14:43:26 +0200 Subject: [PATCH] replace deprecated onSetupMiddleware proxy confing --- packages/config-utils/src/proxy.ts | 4 +++- packages/config/src/lib/config.test.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/config-utils/src/proxy.ts b/packages/config-utils/src/proxy.ts index f2e04ce0f..a0eaaa4db 100644 --- a/packages/config-utils/src/proxy.ts +++ b/packages/config-utils/src/proxy.ts @@ -360,7 +360,7 @@ const proxy = ({ console.log('\u001b[0m'); } }, - onBeforeSetupMiddleware({ app, compiler, options }) { + setupMiddlewares(middlewares, { app, compiler, options }) { app?.enable('strict routing'); // trailing slashes are mean if (shouldBounceProdRequests) { @@ -411,6 +411,8 @@ const proxy = ({ config: standaloneConfig, }) ); + + return middlewares; }, }; diff --git a/packages/config/src/lib/config.test.js b/packages/config/src/lib/config.test.js index 3f3d4c922..0871f46e7 100644 --- a/packages/config/src/lib/config.test.js +++ b/packages/config/src/lib/config.test.js @@ -39,7 +39,7 @@ describe('should create dummy config with no options', () => { test('devServer', () => { expect(devServer).toEqual({ - onBeforeSetupMiddleware: expect.any(Function), + setupMiddlewares: expect.any(Function), onListening: expect.any(Function), static: { directory: '/dist',