Files
dealplustech/node_modules/astro/dist/content/runtime-assets.js
Kunthawat Greethong 443c3377e2 refactor: Move Astro to root, use PORT env (default 80), allow all hosts
- Move Astro files from dealplustech-astro/ to project root
- Update Dockerfile: PORT environment variable (default 80)
- Add vite.config.ts with allowedHosts: true
- Matches nixpacks behavior for Easypanel deployment
- No hardcoded ports or domains
2026-03-03 11:40:50 +07:00

29 lines
917 B
JavaScript

import { z } from "zod";
import { emitESMImage } from "../assets/utils/node/emitAsset.js";
function createImage(pluginContext, shouldEmitFile, entryFilePath, experimentalSvgEnabled) {
return () => {
return z.string().transform(async (imagePath, ctx) => {
const resolvedFilePath = (await pluginContext.resolve(imagePath, entryFilePath))?.id;
const metadata = await emitESMImage(
resolvedFilePath,
pluginContext.meta.watchMode,
// FUTURE: Remove in this in v6
experimentalSvgEnabled,
shouldEmitFile ? pluginContext.emitFile : void 0
);
if (!metadata) {
ctx.addIssue({
code: "custom",
message: `Image ${imagePath} does not exist. Is the path correct?`,
fatal: true
});
return z.never();
}
return { ...metadata, ASTRO_ASSET: metadata.fsPath };
});
};
}
export {
createImage
};