-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
46 lines (44 loc) · 1.1 KB
/
vite.config.js
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
import reactRefresh from "@vitejs/plugin-react-refresh"
import hljs from "highlight.js"
import { plugin as md, Mode } from "vite-plugin-markdown"
import markdownIt from "markdown-it"
import markdownItAttrs from "markdown-it-attrs"
/**
* https://vitejs.dev/config/
* @type { import('vite').UserConfig }
*/
export default {
plugins: [
reactRefresh(),
md({
mode: [Mode.HTML, Mode.TOC, Mode.REACT],
markdown: (body) => {
console.log(`body`, body)
},
markdownIt: markdownIt({
linkify: true,
typographer: true,
highlight: (code, lang) => {
if (lang && hljs.getLanguage(lang)) {
try {
return hljs.highlight(lang, code).value
} catch (__) {}
}
return ""
},
}).use(markdownItAttrs),
}),
],
build: {
// sourcemap: true,
rollupOptions: {
output: {
manualChunks: {
characters: ["/src/lessons/data/characters.json"],
quotes: ["/src/lessons/data/quotes.json"],
chakra: ["@chakra-ui/react"],
},
},
},
},
}