20260920173439

This commit is contained in:
oneao committed 2026-09-20 17:34:40 +08:00
1 parent f4bfc1ddfc
commit 6f03d92425
174 files changed
+23490 -157

No files matched your search

@@ -0,0 +1,25 @@
import { defineConfig } from "vite"
import vue from "@vitejs/plugin-vue"
import { resolve } from "node:path"
export default defineConfig({
plugins: [vue()],
build: {
lib: {
entry: resolve(__dirname, "src/index.ts"),
// 显式指定 es + cjs:缺省的 umd 需要 output.globals,
// 库场景下宿主走打包器消费,不需要 UMD。
formats: ["es", "cjs"],
fileName: (format) => (format === "es" ? "index.js" : "index.cjs"),
},
rollupOptions: {
// 工作区兄弟包与 vue 保持 external,由宿主提供。
external: ["vue", "@report/core", "@report/layout", "@report/designer"],
output: {
// 只用具名导出,避免 ESM/CJS 互操作时 .default 歧义。
exports: "named",
},
},
sourcemap: true,
},
})