Files
2026-06-27 15:15:24 +08:00

24 lines
863 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
// Leafer 插件(@leafer-in/*)通过给 @leafer-ui/draw 的 UI 类打补丁来挂载 animate() 等方法。
// 若 Vite 把 leafer-ui 与各插件分别预打包,会各自内联一份 @leafer-ui/draw
// 导致插件补丁打在 A 份、而 Box/Text 继承自 B 份 → animate() 不生效、报“请安装插件”。
// dedupe + optimizeDeps.include 强制所有 leafer 包共享同一份 @leafer-ui/draw。
const leaferPkgs = [
"leafer-ui",
"@leafer-ui/draw",
"@leafer-ui/core",
"@leafer/core",
"@leafer-in/animate",
"@leafer-in/color"
];
// https://vite.dev/config/
export default defineConfig({
plugins: [react(), tailwindcss()],
resolve: { dedupe: leaferPkgs },
optimizeDeps: { include: leaferPkgs }
});