Newer
Older
hello-programmer-world / astro.config.mjs
@h.sakamoto h.sakamoto on 6 Feb 848 bytes package
// @ts-check

import mdx from '@astrojs/mdx';
import react from '@astrojs/react';
import tailwindcss from '@tailwindcss/vite';
import expressiveCode from 'astro-expressive-code';
import { defineConfig } from 'astro/config';
import remarkToc from 'remark-toc';
import remarkCodeFile from './src/plugins/remarkCodeFile';
import rehypeMermaid from "rehype-mermaid";

// https://astro.build/config
export default defineConfig({
  vite: {
    plugins: [tailwindcss()]
  },

  integrations: [
    expressiveCode({
      themes: ["github-dark", "github-light"],
    }),
    mdx({
      remarkPlugins: [remarkToc, remarkCodeFile],
    }),
    react()
  ],

  markdown: {
    remarkPlugins: [remarkCodeFile],

    syntaxHighlight: {
      excludeLangs: ["mermaid"],
    },
    rehypePlugins: [
      [rehypeMermaid, { strategy: "img-svg" }]
    ],
  },
});