-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
59 lines (56 loc) · 1.76 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
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import svgr from "vite-plugin-svgr";
import dsv from "@rollup/plugin-dsv";
import mdx from "@mdx-js/rollup";
import remarkFrontmatter from "remark-frontmatter";
import remarkMdxFrontmatter from "remark-mdx-frontmatter";
import remarkUnwrapImages from "remark-unwrap-images";
import remarkImages from "remark-images";
import path from "path";
// import {babel} from '@rollup/plugin-babel'
/*
babel({
// Also run on what used to be `.mdx` (but is now JS):
extensions: ['.js', '.jsx', '.cjs', '.mjs', '.md', '.mdx'],
// Other options…
})
*/
export default defineConfig(() => {
return {
define: {
"process.env": {},
},
build: {
commonjsOptions: {
include: ["tailwind-config.cjs", "node_modules/**"],
},
},
optimizeDeps: {
include: ["tailwind-config"],
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
"tailwind-config": path.resolve(__dirname, "./tailwind.config.cjs"),
},
},
plugins: [
react(),
svgr({
include: "**/*.svg",
svgrOptions: {
exportType: "default",
typescript: false,
dimensions: false,
replaceAttrValues: { "#000": "currentColor", "#000000": "currentColor" },
},
}),
dsv(),
mdx({
remarkPlugins: [remarkFrontmatter, remarkMdxFrontmatter, remarkImages, remarkUnwrapImages],
providerImportSource: "@mdx-js/react",
}) as any,
],
};
});