1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-12-22 17:23:22 +01:00

add intersection-observer polyfill

This commit is contained in:
Matthias Kretschmann 2018-05-04 21:48:09 +02:00
parent a394a1fe14
commit 116db3adf2
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 12 additions and 0 deletions

View File

@ -14,6 +14,16 @@ exports.modifyWebpackConfig = ({ config, stage }) => {
return config return config
} }
// https://github.com/gatsbyjs/gatsby/issues/2288#issuecomment-334467821
exports.modifyWebpackConfig = ({ config, stage }) => {
if (stage === 'build-html') {
config.loader('null', {
test: /intersection-observer/,
loader: 'null-loader',
})
}
}
exports.createPages = ({ boundActionCreators, graphql }) => { exports.createPages = ({ boundActionCreators, graphql }) => {
const { createPage } = boundActionCreators const { createPage } = boundActionCreators

View File

@ -26,6 +26,7 @@
"gatsby-source-filesystem": "^1.5.35", "gatsby-source-filesystem": "^1.5.35",
"gatsby-transformer-json": "^1.0.17", "gatsby-transformer-json": "^1.0.17",
"gatsby-transformer-sharp": "^1.6.24", "gatsby-transformer-sharp": "^1.6.24",
"intersection-observer": "^0.5.0",
"react-helmet": "^5.2.0", "react-helmet": "^5.2.0",
"react-markdown": "^3.3.0", "react-markdown": "^3.3.0",
"react-transition-group": "^2.3.1" "react-transition-group": "^2.3.1"

View File

@ -1,6 +1,7 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import Img from 'gatsby-image' import Img from 'gatsby-image'
import 'intersection-observer'
import './ProjectImage.scss' import './ProjectImage.scss'
const ProjectImage = ({ sizes, alt }) => ( const ProjectImage = ({ sizes, alt }) => (