This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Head> | |
<link rel="preconnect" href="https://media.nedigital.sg" /> | |
<link rel="dns-prefetch" href="https://media.nedigital.sg" /> | |
<Head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Head> | |
<link | |
rel="preload" | |
href={imageUrl} | |
as="image" | |
/> | |
</Head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Head> | |
<link | |
rel="preload" | |
href={imageUrl} | |
as="image" | |
imagesrcset={ | |
`${imageUrl} 1200w, | |
${imageUrl}?w=200 200w, | |
${imageUrl}?w=400 400w, | |
${imageUrl}?w=800 800w, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<img | |
src={`${imageUrl}?q=70`} | |
srcSet={`${imageUrl}?q=70 1200w, | |
${imageUrl}?w=200&q=70 200w, | |
${imageUrl}?w=400&q=70 400w, | |
${imageUrl}?w=800&q=70 800w, | |
${imageUrl}?w=1024&q=70 1024w`} | |
/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<img | |
src={imageUrl} | |
srcSet={ | |
`${imageUrl} 1200w, | |
${imageUrl}?w=200 200w, | |
${imageUrl}?w=400 400w, | |
${imageUrl}?w=800 800w, | |
${imageUrl}?w=1024 1024w`} | |
/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer') | |
module.exports = { | |
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => { | |
if (ANALYZE) { | |
config.plugins.push( | |
new BundleAnalyzerPlugin({ | |
analyzerMode: 'server', | |
analyzerPort: isServer ? 8888 : 8889, | |
openAnalyzer: true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( | |
typeof window !== 'undefined' && | |
'IntersectionObserver' in window && | |
'IntersectionObserverEntry' in window && | |
'intersectionRatio' in window.IntersectionObserverEntry.prototype | |
) { | |
let observer = new IntersectionObserver() | |
//rest of the code | |
} else { | |
import('intersection-observer').then(() => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin') | |
module.exports = { | |
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => { | |
config.plugins.push(new DuplicatePackageCheckerPlugin()) | |
config.resolve.alias['fast-deep-equal'] = path.resolve( | |
__dirname, | |
'node_modules', | |
'fast-deep-equal' | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
handleScrollToTop() { | |
import('react-scroll').then(scroll => { | |
scroll.animateScroll.scrollToTop({ | |
}) | |
}) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin') | |
module.exports = { | |
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => { | |
config.plugins.push(new DuplicatePackageCheckerPlugin()) | |
return config | |
}, | |
} |
NewerOlder