Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Phosphor-icons import error on pages with SSR #79

Merged
merged 9 commits into from
Mar 29, 2024
25 changes: 23 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,31 @@ const withBundleAnalyzer = require("@next/bundle-analyzer")({
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
appDir: false,
optimizePackageImports: ["@phosphor-icons/react"],
},
modularizeImports: {
"@phosphor-icons/react": {
transform: "@phosphor-icons/react/dist/ssr/{{member}}",
},
},
images: {
domains: ["images.unsplash.com", "picsum.photos", process.env.S3_BUCKET],
remotePatterns: [
{
protocol: "https",
hostname: "images.unsplash.com",
port: "",
},
{
protocol: "https",
hostname: "picsum.photos",
port: "",
},
{
protocol: "https",
hostname: process.env.S3_BUCKET,
port: "",
},
],
},
};

Expand Down
Loading