-
-
Notifications
You must be signed in to change notification settings - Fork 681
/
Copy pathindex.ts
32 lines (31 loc) · 977 Bytes
/
index.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
// @ts-expect-error -- Browser
if (typeof window !== 'undefined') {
if (typeof require === 'undefined') {
// @ts-expect-error -- Browser
;(window as any).require = () => {
const e = new Error('require is not defined')
;(e as any).code = 'MODULE_NOT_FOUND'
throw e
}
}
}
// @ts-expect-error -- Cannot change `module` option
import type { Theme } from 'vitepress'
// @ts-expect-error -- Cannot change `module` option
import DefaultTheme from 'vitepress/theme'
// @ts-expect-error -- ignore
import Layout from './Layout.vue'
// @ts-expect-error -- ignore
import ESLintCodeBlock from './components/eslint-code-block.vue'
// @ts-expect-error -- ignore
import RulesTable from './components/rules-table.vue'
const theme: Theme = {
...DefaultTheme,
Layout,
enhanceApp(ctx) {
DefaultTheme.enhanceApp(ctx)
ctx.app.component('eslint-code-block', ESLintCodeBlock)
ctx.app.component('rules-table', RulesTable)
}
}
export default theme