Files
30-seconds-of-code/node_modules/gatsby-plugin-offline/gatsby-ssr.js
2019-08-20 15:52:05 +02:00

20 lines
774 B
JavaScript

"use strict";
exports.__esModule = true;
exports.onPreRenderHTML = void 0;
var onPreRenderHTML = function onPreRenderHTML(_ref) {
var getHeadComponents = _ref.getHeadComponents,
pathname = _ref.pathname,
replaceHeadComponents = _ref.replaceHeadComponents;
if (pathname !== "/offline-plugin-app-shell-fallback/") return;
var headComponents = getHeadComponents();
var filteredHeadComponents = headComponents.filter(function (_ref2) {
var type = _ref2.type,
props = _ref2.props;
return !(type === "link" && props.as === "fetch" && props.rel === "preload" && (props.href.startsWith("/static/d/") || props.href.startsWith("/page-data/")));
});
replaceHeadComponents(filteredHeadComponents);
};
exports.onPreRenderHTML = onPreRenderHTML;