import { defineConfig } from "@solidjs/start/config";
import typst from "@myriaddreamin/vite-plugin-typst";
import remarkFrontmatter from "remark-frontmatter";
import remarkGfm from "remark-gfm";
import rehypeShiki from "@shikijs/rehype";
import {
transformerNotationHighlight,
transformerNotationWordHighlight,
} from "@shikijs/transformers";
import rehypeMdxCodeProps from "rehype-mdx-code-props";
import rehypeSlug from "rehype-slug";
import { metadataPlugin } from "./build-helpers/metadataPlugin";
// @ts-ignore
import pkg from "@vinxi/plugin-mdx";
const { default: mdx } = pkg;
const defineString = (str?: string) => `"${str || "unknown"}"`;
const NITRO_PRESET = process.env.SERVER_PRESET || "cloudflare_pages";
const WEBSITE = "https://a2va.dev";
export default defineConfig({
extensions: ["mdx", "md", "typ"],
server: {
preset: NITRO_PRESET,
// https://developers.cloudflare.com/pages/framework-guides/deploy-a-solid-start-site/
...(NITRO_PRESET.startsWith("cloudflare-pages") && {
rollupConfig: {
external: ["__STATIC_CONTENT_MANIFEST", "node:async_hooks"],
},
}),
},
vite: {
plugins: [
typst(),
metadataPlugin(),
mdx.withImports({})({
remarkPlugins: [remarkFrontmatter, remarkGfm],
jsx: true,
jsxImportSource: "solid-js",
providerImportSource: "solid-mdx",
}),
],
define: {
__APP_NODE_ENV: defineString(process.env.NODE_ENV),
__APP_WEBSITE: defineString(WEBSITE),
},
},
});
import { defineConfig } from "@solidjs/start/config";
import typst from "@myriaddreamin/vite-plugin-typst";
import remarkFrontmatter from "remark-frontmatter";
import remarkGfm from "remark-gfm";
import rehypeShiki from "@shikijs/rehype";
import {
transformerNotationHighlight,
transformerNotationWordHighlight,
} from "@shikijs/transformers";
import rehypeMdxCodeProps from "rehype-mdx-code-props";
import rehypeSlug from "rehype-slug";
import { metadataPlugin } from "./build-helpers/metadataPlugin";
// @ts-ignore
import pkg from "@vinxi/plugin-mdx";
const { default: mdx } = pkg;
const defineString = (str?: string) => `"${str || "unknown"}"`;
const NITRO_PRESET = process.env.SERVER_PRESET || "cloudflare_pages";
const WEBSITE = "https://a2va.dev";
export default defineConfig({
extensions: ["mdx", "md", "typ"],
server: {
preset: NITRO_PRESET,
// https://developers.cloudflare.com/pages/framework-guides/deploy-a-solid-start-site/
...(NITRO_PRESET.startsWith("cloudflare-pages") && {
rollupConfig: {
external: ["__STATIC_CONTENT_MANIFEST", "node:async_hooks"],
},
}),
},
vite: {
plugins: [
typst(),
metadataPlugin(),
mdx.withImports({})({
remarkPlugins: [remarkFrontmatter, remarkGfm],
jsx: true,
jsxImportSource: "solid-js",
providerImportSource: "solid-mdx",
}),
],
define: {
__APP_NODE_ENV: defineString(process.env.NODE_ENV),
__APP_WEBSITE: defineString(WEBSITE),
},
},
});