XuqmGroup-Vue3SDK/vite.config.ts
XuqmGroup df7557b77f fix(ImClient): make sendSync/scheduleReconnect safe when SDK not initialized
ImClient.sendSync() called getConfig() which throws when init() hasn't been
called, breaking headless usage (e.g. platform event listeners). Now wraps
the call in a try-catch and skips the sync frame if appKey is unavailable.
Same fix for scheduleReconnect's debug log.

Also: add vite-plugin-dts to generate TypeScript declarations on every build,
fixing the missing dist/index.d.ts that broke IDE type resolution. Bump to 0.2.3.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 14:12:47 +08:00

29 行
622 B
TypeScript

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import dts from 'vite-plugin-dts'
import { resolve } from 'path'
export default defineConfig({
plugins: [
vue(),
dts({ include: ['src'], insertTypesEntry: true }),
],
build: {
lib: {
entry: resolve(__dirname, 'src/index.ts'),
name: 'XuqmVue3SDK',
formats: ['es', 'cjs'],
fileName: (format) => `index.${format}.js`,
},
rollupOptions: {
external: ['vue'],
output: {
globals: { vue: 'Vue' },
},
},
},
resolve: {
alias: { '@': resolve(__dirname, 'src') },
},
})