speice.io/vite.config.ts

32 lines
951 B
TypeScript
Raw Normal View History

2023-04-15 12:56:22 -04:00
import { defineConfig } from "vite";
import blog from "@bspeice/vite-plugin-blog";
import mdx from "@mdx-js/rollup";
import react from "@vitejs/plugin-react-swc";
2023-04-21 21:39:53 -04:00
import rehypeHighlight from "rehype-highlight";
2023-04-23 17:15:48 -04:00
import rehypeKatex from "rehype-katex";
import remarkFrontmatter from "remark-frontmatter";
2023-04-23 17:15:48 -04:00
import remarkMath from "remark-math";
import remarkMdxFrontmatter from "remark-mdx-frontmatter";
2023-04-15 12:55:22 -04:00
export default defineConfig({
2023-04-21 23:03:34 -04:00
build: {
rollupOptions: {
external: ["react-icons"],
},
},
2023-04-15 12:55:22 -04:00
plugins: [
blog({
2023-04-16 20:10:40 -04:00
"/": "/pages/index.tsx",
"/about": "/pages/about.mdx",
"/2019/02/the-whole-world": "/posts/2019/02/the-whole-world.mdx",
2023-06-25 21:56:33 -04:00
"/2023/06/flam3": "/posts/2023/06/flam3/index.tsx",
2023-04-15 12:55:22 -04:00
}),
2023-04-23 17:15:48 -04:00
mdx({
remarkPlugins: [remarkFrontmatter, remarkMath, remarkMdxFrontmatter],
2023-04-23 17:44:49 -04:00
rehypePlugins: [rehypeHighlight, rehypeKatex],
providerImportSource: "@mdx-js/react",
2023-04-23 17:15:48 -04:00
}),
2023-04-15 12:56:22 -04:00
react(),
2023-04-15 12:55:22 -04:00
],
2023-04-15 12:56:22 -04:00
});