index.ts 802 B

12345678910111213141516171819202122232425
  1. // https://vitepress.dev/guide/custom-theme
  2. import type { Theme } from "vitepress";
  3. import DefaultTheme from "vitepress/theme";
  4. import ElementPlus from 'element-plus'
  5. import CustomLayout from "../../components/CustomLayout.vue";
  6. import i18n from "../../plugins/i18n";
  7. import 'element-plus/dist/index.css'
  8. import "./style.css";
  9. import "./custom-doc.scss";
  10. export default {
  11. extends: DefaultTheme,
  12. Layout: CustomLayout,
  13. enhanceApp({ app, router, siteData }) {
  14. // NOTE polyfill `process` for library `path-browserify`,@SEE: https://github.com/browserify/path-browserify/issues/34
  15. if (!import.meta.env.SSR) {
  16. import('process/browser').then((module) => {
  17. globalThis.process = module
  18. })
  19. }
  20. app.use(i18n);
  21. app.use(ElementPlus)
  22. // ...
  23. },
  24. } satisfies Theme;