Files
emdash-patch-imageupload/templates/marketing/astro.config.mjs
kunthawat 2d1be52177 Emdash source with visual editor image upload fix
Fixes:
1. media.ts: wrap placeholder generation in try-catch
2. toolbar.ts: check r.ok, display error message in popover
2026-05-03 10:44:54 +07:00

72 lines
1.6 KiB
JavaScript

import node from "@astrojs/node";
import react from "@astrojs/react";
import icon from "astro-iconset";
import { defineConfig, fontProviders } from "astro/config";
import emdash, { local } from "emdash/astro";
import { sqlite } from "emdash/db";
export default defineConfig({
output: "server",
adapter: node({
mode: "standalone",
}),
image: {
layout: "constrained",
responsiveStyles: true,
},
integrations: [
react(),
icon({
// Only ship the Phosphor icons actually referenced in templates,
// not the full @iconify-json/ph set.
include: {
ph: [
"chart-bar",
"check-circle",
"clock",
"cloud",
"code",
"currency-dollar",
"envelope",
"globe",
"heart",
"lifebuoy",
"lightning",
"lock",
"shield-check",
"sparkle",
"star",
"users-three",
],
},
}),
emdash({
database: sqlite({ url: "file:./data.db" }),
storage: local({
directory: "./uploads",
baseUrl: "/_emdash/api/media/file",
}),
plugins: [
{
id: "marketing-blocks",
version: "0.1.0",
// Absolute file:// URL so the virtual emdash/plugins module
// can resolve this at build time (relative paths fail because
// the virtual module has no on-disk location to anchor them).
entrypoint: new URL("./src/plugins/marketing-blocks/index.ts", import.meta.url).href,
},
],
}),
],
fonts: [
{
provider: fontProviders.google(),
name: "Inter",
cssVariable: "--font-sans",
weights: [400, 500, 600, 700, 800],
fallbacks: ["sans-serif"],
},
],
devToolbar: { enabled: false },
});