-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathvite.config.ts
84 lines (80 loc) · 2.34 KB
/
vite.config.ts
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import { reactRouter } from "@react-router/dev/vite";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
import { setDefaultResultOrder } from "node:dns";
import mdx from "@mdx-js/rollup";
import remarkFrontmatter from "remark-frontmatter";
import remarkMdxFrontmatter from "remark-mdx-frontmatter";
import remarkMdxImages from "./scripts/remark-mdx-images";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
import rehypeSlug from "rehype-slug";
import rehypeShiki from "@shikijs/rehype";
import { iconsSpritesheet } from "vite-plugin-icons-spritesheet";
import { componentDocs } from "./scripts/componentDocs";
setDefaultResultOrder("ipv4first");
export default defineConfig({
plugins: [
mdx({
remarkPlugins: [
remarkFrontmatter,
remarkMdxFrontmatter,
// @ts-ignore
remarkMdxImages,
],
rehypePlugins: [
rehypeSlug,
rehypeAutolinkHeadings,
[rehypeShiki, { theme: "one-dark-pro" }],
],
}),
iconsSpritesheet({
// Defaults to false, should it generate TS types for you
withTypes: true,
// The path to the icon directory
inputDir: "app/icons",
// Output path for the generated spritesheet and types
outputDir: "app/components/ui/icons",
// Output path for the generated type file, defaults to types.ts in outputDir
typesOutputFile: "app/components/ui/icons/name.d.ts",
// What formatter to use to format the generated files, prettier or biome, defaults to no formatter
// formatter: "biome",
// The path to the formatter config file, defaults to no path
// pathToFormatterConfig: "./biome.json",
iconNameTransformer: (name) => name,
}),
reactRouter(),
tsconfigPaths(),
componentDocs(),
],
build: {
outDir: "../build",
emptyOutDir: true,
rollupOptions: {
onwarn: (warning, warn) => {},
},
},
define: {
"process.env.THORIUMSIM_CLIENT_ID": `"01FM3JNPNP3GFAXYR22Y7F9XAJ"`,
"process.env.THORIUMSIM_URL": `"https://thoriumsim.com"`,
},
base: "/",
server: {
port: 3000,
host: "0.0.0.0",
open: true,
fs: {
strict: false,
// Allow serving files from one level up to the project root
allow: [".."],
},
proxy: {
"/netSend": "http://localhost:3001",
"/netRequest": "http://localhost:3001",
"/plugins": "http://localhost:3001",
"/ws": {
target: "ws://localhost:3001/ws",
ws: true,
},
},
},
});