Cấu hình Vite

Môi trường: node
Hàm cài đặt này sẽ chỉ chạy trên môi trường Node.js, bạn có thể có quyền truy cập vào API của Node.

Slidev được cung cấp bởi Vite. Điều này có nghĩa là bạn có thể tận dụng hệ thống plugin tuyệt vời của Vite để tùy chỉnh các trang trình bày của mình hơn nữa.

Nếu có file vite.config.js trong dự án, nó sẽ được đọc.

Slidev có các plugin sau được cấu hình sẵn:

Invalid code snippet option

Tìm hiểu thêm về Cấu hình trước đó.

Learn more about the pre-configurations here.

Configure Internal Plugins

Available since v0.21

To configure the built-in plugins list above, create vite.config.ts with the following content. Please note Slidev has some preconfigure options for those plugins, this usage will override some of them, which could potentially cause the app to break. Please treat this as an advanced feature, make sure you know what you are doing before moving on.

import { defineConfig } from 'vite'

export default defineConfig({
  slidev: {
    vue: {
      /* vue options */
    },
    markdown: {
      /* markdown-it options */
      markdownItSetup(md) {
        /* custom markdown-it plugins */
        md.use(/* ... */)
      },
    },
    /* options for other plugins */
  },
})

See the type declarations for more options.

33596b32fd16d21d346827c2a02957f6a062f0e3