vite.config.ts 676 B

12345678910111213141516
  1. import vue from '@vitejs/plugin-vue'
  2. import UnoCSS from 'unocss/vite'
  3. import { defineConfig } from 'vite'
  4. // 发布给业务平台的库构建:UnoCSS 使用 vue-scoped 模式,生成的原子类写进各组件的 scoped 样式,
  5. // 不会与宿主平台自己的 UnoCSS / Tailwind 类冲突;所有样式汇总到 dist/style.css
  6. export default defineConfig({
  7. plugins: [vue(), UnoCSS({ mode: 'vue-scoped' })],
  8. build: {
  9. lib: { entry: 'src/index.ts', formats: ['es'], fileName: 'index', cssFileName: 'style' },
  10. rollupOptions: { external: ['vue', 'markdown-it', '@agent-server/client'] },
  11. target: 'es2022',
  12. outDir: 'dist',
  13. emptyOutDir: true,
  14. },
  15. })