File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
packages/angular/build/src/tools/vite/middlewares Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 66 * found in the LICENSE file at https://angular.dev/license
77 */
88
9+ import { extname } from 'node:path' ;
910import type { Connect , ViteDevServer } from 'vite' ;
1011import {
1112 AngularMemoryOutputFiles ,
@@ -28,13 +29,14 @@ export function createAngularIndexHtmlMiddleware(
2829 // Parse the incoming request.
2930 // The base of the URL is unused but required to parse the URL.
3031 const pathname = pathnameWithoutBasePath ( req . url , server . config . base ) ;
31- if ( pathname !== '/' && pathname !== '/index.html' ) {
32+ const extension = extname ( pathname ) ;
33+ if ( extension !== '.html' ) {
3234 next ( ) ;
3335
3436 return ;
3537 }
3638
37- const rawHtml = outputFiles . get ( '/index.html' ) ?. contents ;
39+ const rawHtml = outputFiles . get ( pathname ) ?. contents ;
3840 if ( ! rawHtml ) {
3941 next ( ) ;
4042
You can’t perform that action at this time.
0 commit comments