-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
57 lines (54 loc) · 1.55 KB
/
vite.config.ts
File metadata and controls
57 lines (54 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import mdx from "@mdx-js/rollup";
import {
cloudflareDevProxyVitePlugin,
vitePlugin as remix,
} from "@remix-run/dev";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
import rehypePrettyCode from "rehype-pretty-code";
import rehypeSlug from "rehype-slug";
import remarkFrontmatter from "remark-frontmatter";
import remarkGfm from "remark-gfm";
import remarkMdxFrontmatter from "remark-mdx-frontmatter";
import { defineConfig } from "vite";
import { envOnlyMacros } from "vite-env-only";
import tsconfigPaths from "vite-tsconfig-paths";
import type { Env } from "./context";
// Augment Remix's Future interface for Single Fetch type inference
declare module "@remix-run/cloudflare" {
interface Future {
v3_singleFetch: true;
}
}
export default defineConfig({
plugins: [
envOnlyMacros(),
tsconfigPaths(),
mdx({
remarkPlugins: [remarkFrontmatter, remarkMdxFrontmatter, remarkGfm],
rehypePlugins: [
rehypeSlug,
[rehypeAutolinkHeadings, { behavior: "wrap" }],
[rehypePrettyCode, { theme: "one-dark-pro" }] as any,
],
}),
cloudflareDevProxyVitePlugin<Env>({
getLoadContext: async ({
context: {
cloudflare: { env },
},
}) => {
const { getLoadContext } = await import("./context");
return getLoadContext(env);
},
}),
remix({
future: {
v3_fetcherPersist: true,
v3_relativeSplatPath: true,
v3_throwAbortReason: true,
v3_lazyRouteDiscovery: true,
v3_singleFetch: true,
},
}),
],
});