From 1f4d0c7da903a17091f52bfbfd9ac1f9013d480f Mon Sep 17 00:00:00 2001 From: Rupert Redington Date: Tue, 3 Oct 2023 13:56:35 +0100 Subject: [PATCH] Update to new Plausible proxy methods We use a same-domain proxy for our Plausible anlytics to reassure privacy tools that we control our data carefully. THe support for doing this in Plausible changed from DNS level changes to preferring local proxies. This is well-supported by next-plausible: https://plausible.io/docs/proxy/guides/nextj --- next.config.js | 6 +++++- src/components/Providers.tsx | 5 +---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/next.config.js b/next.config.js index 3997e9ac0..734b4d5a2 100644 --- a/next.config.js +++ b/next.config.js @@ -59,5 +59,9 @@ const withNextAnalyser = require('@next/bundle-analyzer')({ enabled: process.env.ANALYZE === 'true', }); +// https://plausible.io/docs/proxy/guides/nextjs +// eslint-disable-next-line @typescript-eslint/no-var-requires +const { withPlausibleProxy } = require('next-plausible'); + // eslint-disable-next-line functional/immutable-data -module.exports = withNextAnalyser(moduleExports); +module.exports = withNextAnalyser(withPlausibleProxy(moduleExports)); diff --git a/src/components/Providers.tsx b/src/components/Providers.tsx index 13791e16a..9732518ab 100644 --- a/src/components/Providers.tsx +++ b/src/components/Providers.tsx @@ -18,10 +18,7 @@ const Providers: React.FC<{ children: React.ReactNode }> = ({ children }) => { }, [disableDynamicMediaQueries]); return ( - + {globalStyles}