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 6
6
* found in the LICENSE file at https://angular.dev/license
7
7
*/
8
8
9
+ import { extname } from 'node:path' ;
9
10
import type { Connect , ViteDevServer } from 'vite' ;
10
11
import {
11
12
AngularMemoryOutputFiles ,
@@ -28,13 +29,14 @@ export function createAngularIndexHtmlMiddleware(
28
29
// Parse the incoming request.
29
30
// The base of the URL is unused but required to parse the URL.
30
31
const pathname = pathnameWithoutBasePath ( req . url , server . config . base ) ;
31
- if ( pathname !== '/' && pathname !== '/index.html' ) {
32
+ const extension = extname ( pathname ) ;
33
+ if ( extension !== '.html' ) {
32
34
next ( ) ;
33
35
34
36
return ;
35
37
}
36
38
37
- const rawHtml = outputFiles . get ( '/index.html' ) ?. contents ;
39
+ const rawHtml = outputFiles . get ( pathname ) ?. contents ;
38
40
if ( ! rawHtml ) {
39
41
next ( ) ;
40
42
You can’t perform that action at this time.
0 commit comments