Skip to content
Source
Sign inSign up
fuko/trytanstackdb.com
Open History to see the last commit

vite.config.ts

36 lines967 Bytes

1import { cloudflare } from "@cloudflare/vite-plugin";
2import mdx from "@mdx-js/rollup";
3import tailwindcss from "@tailwindcss/vite";
4import { tanstackStart } from "@tanstack/react-start/plugin/vite";
5import viteReact from "@vitejs/plugin-react";
6import rehypePrism from "rehype-prism-plus";
7import { defineConfig } from "vite";
8import viteTsConfigPaths from "vite-tsconfig-paths";
9​
10const config = defineConfig({
11 // server: {
12 // host: true,
13 // hmr: {
14 // host: "localhost", // or leave undefined for all
15 // },
16 // allowedHosts: [".localhost"],
17 // },
18 plugins: [
19 cloudflare({ viteEnvironment: { name: "ssr" } }),
20 // this is the plugin that enables path aliases
21 viteTsConfigPaths({
22 projects: ["./tsconfig.json"],
23 }),
24 tailwindcss(),
25 tanstackStart(),
26 viteReact(),
27 mdx({
28 rehypePlugins: [rehypePrism],
29 }),
30 ],
31 optimizeDeps: {
32 exclude: ["@electric-sql/pglite"],
33 },
34});
35​
36export default config;