Skip to content

Commit

Permalink
Pause any videos not currently in view
Browse files Browse the repository at this point in the history
For performance
Also add AVIF images to gatsby-config
  • Loading branch information
RYRY1002 committed Oct 23, 2024
1 parent 4b2620c commit 64029aa
Show file tree
Hide file tree
Showing 5 changed files with 1,006 additions and 673 deletions.
29 changes: 8 additions & 21 deletions gatsby-config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ const config = {
flags: {
DEV_SSR: false,
FAST_DEV: true,
DETECT_NODE_MUTATIONS: false // Do not enable this in production builds, it will cause it to fail!
DETECT_NODE_MUTATIONS: false, // Do not enable this in production builds, it will cause it to fail!
PARTIAL_HYDRATION: false
},
plugins: [
"gatsby-plugin-postcss", "gatsby-plugin-image", "gatsby-plugin-sitemap", "gatsby-plugin-preload-fonts",
Expand Down Expand Up @@ -139,28 +140,14 @@ const config = {
resolve: "gatsby-plugin-sharp",
options: {
defaults: {
formats: ["webp"],
formats: ["avif", "webp"],
placeholder: "blurred",
breakpoints: [480, 720, 1080, 1366, 1920, 2560, 3840],
backgroundColor: "transparent"
}
}
}, {
resolve: "gatsby-plugin-purgecss",
options: {
printRejected: false,
tailwind: true,
//develop: true,
purgeCSSOptions: {
content: [
path.join(process.cwd(), "src/**/!(*.d).{ts,js,jsx,tsx,md,mdx}"),

// This will absolutely nuke build performance.
//path.join(process.cwd(), "node_modules/**/!(*.d).{ts,js,jsx,tsx,md,mdx}"),
],
safelist: [
"material-symbols"
]
backgroundColor: "transparent",
blurredOptions: {
toFormat: "webp",
width: 48
}
}
}
}, {
Expand Down
Loading

0 comments on commit 64029aa

Please sign in to comment.