feat: stash-ui 0.1.0(40 个组件 + 文档站 + 主题机制)

This commit is contained in:
stash
2026-10-28 20:44:18 +08:00
commit 52296b3368
153 changed files with 17129 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
/**
* 组件库构建:产出 ESM 包 + 单份样式表。
*
* react / react-dom 外置,由使用方提供;
* 样式(令牌 + 图标字体 + 各组件的 CSS Modules)由 Vite 合并成 `dist/stash-ui.css`。
* 图标字体在 lib 模式下会被内联成 data URI——这是有意的:
* 使用方只需要引一个 CSS,不用再处理字体文件路径(对单二进制内嵌尤其省事)。
*/
export default defineConfig({
plugins: [react()],
build: {
lib: {
entry: 'src/index.ts',
formats: ['es'],
fileName: 'stash-ui',
cssFileName: 'stash-ui',
},
rollupOptions: {
external: ['react', 'react-dom', 'react/jsx-runtime'],
},
},
})