Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/open-next/src/overrides/imageLoader/fs-dev.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import fs from "node:fs";
import path from "node:path";

import type { ImageLoader } from "types/overrides";
import { getMonorepoRelativePath } from "utils/normalize-path";

export default {
name: "fs-dev",
load: async (url: string) => {
const basePath = "../../assets";
const body = fs.createReadStream(`${basePath}/${url}`);
const imagePath = path.join(getMonorepoRelativePath(), "assets", url);
const body = fs.createReadStream(imagePath);
const contentType = url.endsWith(".png") ? "image/png" : "image/jpeg";
return {
body,
Expand Down
Loading