fix(docs): тихо отвечать 204 на .map запросы
Diplodoc CLI 4.60 не генерит sourcemaps, но оставляет `//# sourceMappingURL=app.css.map` комментарии в JS/CSS bundles. DevTools тянет .map файлы → 404 в console (6 ошибок на /docs/). Nginx теперь возвращает 204 No Content для *.map под /docs/ — DevTools тихо проглатывает, console зелёная.
This commit is contained in:
@@ -16,6 +16,15 @@ server {
|
|||||||
add_header Content-Type text/plain;
|
add_header Content-Type text/plain;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Source maps: Diplodoc CLI 4.60 не генерит .map файлы, но оставляет
|
||||||
|
# `//# sourceMappingURL=` комментарии в JS/CSS. DevTools пытается тянуть,
|
||||||
|
# получает 404 — шум в console. Возвращаем 204 No Content тихо.
|
||||||
|
location ~* "^/docs/.*\.map$" {
|
||||||
|
access_log off;
|
||||||
|
log_not_found off;
|
||||||
|
return 204;
|
||||||
|
}
|
||||||
|
|
||||||
# Static assets (Diplodoc CLI 4.60 bug: HTML refs hashed names типа
|
# Static assets (Diplodoc CLI 4.60 bug: HTML refs hashed names типа
|
||||||
# `_bundle/app-34c68624e23be7ce.css`, но actual файл — `app.css` (без
|
# `_bundle/app-34c68624e23be7ce.css`, но actual файл — `app.css` (без
|
||||||
# hash). Strip hash в nginx через rewrite: `name-<hash>.ext` → `name.ext`.
|
# hash). Strip hash в nginx через rewrite: `name-<hash>.ext` → `name.ext`.
|
||||||
|
|||||||
Reference in New Issue
Block a user