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>
29 行
622 B
TypeScript
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') },
|
|
},
|
|
})
|