Skip to content

Commit

Permalink
nextjs strikes again...
Browse files Browse the repository at this point in the history
remove image loader, won't work with API_ADDRESS at runtime...

for now, just use a custom image loader that does nothing to bypass next/image rules and avoid needing to change every single <Image /> component right now.
  • Loading branch information
Southclaws committed Dec 27, 2024
1 parent 52fa161 commit d82c7bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
17 changes: 3 additions & 14 deletions web/next.config.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
/** @type {import('next').NextConfig} */

const isStandalone = process.env.NEXT_BUILD_STANDALONE === "true";

const API_ADDRESS =
process.env["NEXT_PUBLIC_API_ADDRESS"] ?? "http://localhost:8000";

const apiURL = new URL(API_ADDRESS);

/** @type {import('next').NextConfig} */
const nextConfig = {
output: isStandalone ? "standalone" : undefined,
reactStrictMode: true,
images: {
remotePatterns: [
{
protocol: apiURL.protocol.replace(":", ""),
hostname: apiURL.hostname,
port: apiURL.port,
},
],
loader: "custom",
loaderFile: "./src/lib/asset/loader.js",
},
};

Expand Down
4 changes: 4 additions & 0 deletions web/src/lib/asset/loader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// don't even ask... TODO: remove next/image from everywhere.
export default function myHackyWorkaround({ src }) {
return src;
}

0 comments on commit d82c7bd

Please sign in to comment.