index.ts 774 B

123456789101112131415161718192021222324
  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. export default {
  10. extends: DefaultTheme,
  11. Layout: CustomLayout,
  12. enhanceApp({ app, router, siteData }) {
  13. // NOTE polyfill `process` for library `path-browserify`,@SEE: https://github.com/browserify/path-browserify/issues/34
  14. if (!import.meta.env.SSR) {
  15. import('process/browser').then((module) => {
  16. globalThis.process = module
  17. })
  18. }
  19. app.use(i18n);
  20. app.use(ElementPlus)
  21. // ...
  22. },
  23. } satisfies Theme;