diff --git a/next.config.js b/next.config.js index 44b6f39..17072d7 100644 --- a/next.config.js +++ b/next.config.js @@ -68,15 +68,15 @@ const nextConfig = { use: ["@svgr/webpack"], }); - // if (!dev && !isServer) { - // // Replace React with Preact only in client production build - // Object.assign(config.resolve.alias, { - // "react/jsx-runtime.js": "preact/compat/jsx-runtime", - // react: "preact/compat", - // "react-dom/test-utils": "preact/test-utils", - // "react-dom": "preact/compat", - // }); - // } + if (!dev && !isServer) { + // Replace React with Preact only in client production build + Object.assign(config.resolve.alias, { + "react/jsx-runtime.js": "preact/compat/jsx-runtime", + react: "preact/compat", + "react-dom/test-utils": "preact/test-utils", + "react-dom": "preact/compat", + }); + } return config; }, diff --git a/package.json b/package.json index fb15dae..3faa44f 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "next-seo": "4.28.1", "next-themes": "0.1.1", "postcss": "^8.4.4", + "preact": "^10.7.1", "querystring": "^0.2.1", "react": "^18.0.0", "react-datocms": "^1.6.3", diff --git a/yarn.lock b/yarn.lock index f7fc63c..b0c8f2e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6585,6 +6585,11 @@ preact@^10.6.3: resolved "https://registry.yarnpkg.com/preact/-/preact-10.6.6.tgz#f1899bc8dab7c0788b858481532cb3b5d764a520" integrity sha512-dgxpTFV2vs4vizwKohYKkk7g7rmp1wOOcfd4Tz3IB3Wi+ivZzsn/SpeKJhRENSE+n8sUfsAl4S3HiCVT923ABw== +preact@^10.7.1: + version "10.7.1" + resolved "https://registry.yarnpkg.com/preact/-/preact-10.7.1.tgz#bdd2b2dce91a5842c3b9b34dfe050e5401068c9e" + integrity sha512-MufnRFz39aIhs9AMFisonjzTud1PK1bY+jcJLo6m2T9Uh8AqjD77w11eAAawmjUogoGOnipECq7e/1RClIKsxg== + prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"