@@ -28,6 +28,12 @@ module.exports = { | |||
`gatsby-plugin-typescript`, | |||
`gatsby-plugin-layout`, | |||
'gatsby-plugin-react-helmet', | |||
{ | |||
resolve: `gatsby-plugin-polyfill-io`, | |||
options: { | |||
features: [`Promise`, `fetch`, `Object.assign`, `Symbol`, `Array.from`] | |||
} | |||
}, | |||
{ | |||
resolve: `sonarsource-source-filesystem`, | |||
options: { name: 'src', path: `${__dirname}/src/` } |
@@ -8,6 +8,7 @@ | |||
"classnames": "2.2.6", | |||
"gatsby": "2.2.8", | |||
"gatsby-plugin-layout": "1.0.13", | |||
"gatsby-plugin-polyfill-io": "1.1.0", | |||
"gatsby-plugin-react-helmet": "3.0.10", | |||
"gatsby-plugin-typescript": "2.0.11", | |||
"gatsby-plugin-typography": "2.2.10", |
@@ -82,9 +82,22 @@ export default class PluginMetaData extends React.Component<Props, State> { | |||
const pageContainer = document.querySelector('.page-container'); | |||
if (pageContainer) { | |||
const iterator = document.createNodeIterator(pageContainer, NodeFilter.SHOW_COMMENT, { | |||
acceptNode: (_: Node) => NodeFilter.FILTER_ACCEPT | |||
}); | |||
// The following uses an older syntax for createNodeIterator() in order | |||
// to support IE11 | |||
// - IE doesn't support the new { acceptNode: (node: Node) => number } | |||
// format for the 3rd parameter, and instead expects to get it passed | |||
// the function directly. Modern browsers support both paradigms as a | |||
// fallback, so we fallback to the old one. | |||
// - IE11 requires the 4th argument. | |||
// @ts-ignore: tsc requires an additional comment at the function call. | |||
const iterator = document.createNodeIterator( | |||
pageContainer, | |||
NodeFilter.SHOW_COMMENT, | |||
// @ts-ignore: IE11 doesn't support the { acceptNode: () => number } format. | |||
(_: Node) => NodeFilter.FILTER_ACCEPT, | |||
// @ts-ignore: IE11 requires the 4th argument. | |||
false | |||
); | |||
let node; | |||
const wrappers: Dict<HTMLDivElement> = {}; |
@@ -4826,6 +4826,13 @@ gatsby-plugin-page-creator@^2.0.11: | |||
parse-filepath "^1.0.1" | |||
slash "^1.0.0" | |||
gatsby-plugin-polyfill-io@^1.1.0: | |||
version "1.1.0" | |||
resolved "https://repox.jfrog.io/repox/api/npm/npm/gatsby-plugin-polyfill-io/-/gatsby-plugin-polyfill-io-1.1.0.tgz#61424c773ae123680e50b9a6692a4b939a1e6e13" | |||
integrity sha1-YUJMdzrhI2gOULmmaSpLk5oebhM= | |||
dependencies: | |||
babel-runtime "^6.26.0" | |||
gatsby-plugin-react-helmet@3.0.10: | |||
version "3.0.10" | |||
resolved "https://registry.yarnpkg.com/gatsby-plugin-react-helmet/-/gatsby-plugin-react-helmet-3.0.10.tgz#08a4f3f7d6ffd020d78817679535fb6548602302" |