diff --git a/packages/angular_devkit/build_angular/src/builders/dev-server/vite-server.ts b/packages/angular_devkit/build_angular/src/builders/dev-server/vite-server.ts index 9adff6640e5b..4ecea65a1bbb 100644 --- a/packages/angular_devkit/build_angular/src/builders/dev-server/vite-server.ts +++ b/packages/angular_devkit/build_angular/src/builders/dev-server/vite-server.ts @@ -393,6 +393,14 @@ export async function setupServer( } transformIndexHtmlAndAddHeaders(url, rawHtml, res, next, async (html) => { + /* eslint-disable no-console */ + const originalConsoleLog = console.log; + console.log = (...args) => { + if (args[0] !== 'Angular is running in development mode.') { + originalConsoleLog.apply(args); + } + }; + const { content } = await renderPage({ document: html, route: pathnameWithoutServePath(url, serverOptions), @@ -407,6 +415,9 @@ export async function setupServer( inlineCriticalCss: false, }); + console.log = originalConsoleLog; + /* eslint-enable no-console */ + return content; }); }