mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-14 09:37:18 +08:00
fix(@angular/build): suppress asset missing warning for /index.html
requests
Prevent incorrect warning display when the Service Worker requests `/index.html`.
This commit is contained in:
parent
87b310a13f
commit
f92787947f
@ -28,7 +28,10 @@ export function angularHtmlFallbackMiddleware(
|
||||
|
||||
if (req.url) {
|
||||
const mimeType = lookupMimeTypeFromRequest(req.url);
|
||||
if (mimeType === 'text/html' || mimeType === 'application/xhtml+xml') {
|
||||
if (
|
||||
(mimeType === 'text/html' || mimeType === 'application/xhtml+xml') &&
|
||||
!/^\/index\.(?:csr\.)?html/.test(req.url)
|
||||
) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(
|
||||
`Request for HTML file "${req.url}" was received but no asset found. Asset may be missing from build.`,
|
||||
|
Loading…
x
Reference in New Issue
Block a user