feat(rpc): export RpcClient from main entry point (#374)
This commit is contained in:
15
.changeset/rpc-export-client.md
Normal file
15
.changeset/rpc-export-client.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
"@esengine/rpc": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
feat: export RpcClient and connect from main entry point
|
||||||
|
|
||||||
|
Re-export `RpcClient`, `connect`, and related types from the main entry point for better compatibility with bundlers (Cocos Creator, Vite, etc.) that may have issues with subpath exports.
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// Now works in all environments:
|
||||||
|
import { rpc, RpcClient, connect } from '@esengine/rpc';
|
||||||
|
|
||||||
|
// Subpath import still supported:
|
||||||
|
import { RpcClient } from '@esengine/rpc/client';
|
||||||
|
```
|
||||||
@@ -40,3 +40,7 @@
|
|||||||
|
|
||||||
export { rpc } from './define'
|
export { rpc } from './define'
|
||||||
export * from './types'
|
export * from './types'
|
||||||
|
|
||||||
|
// Re-export client for browser/bundler compatibility
|
||||||
|
export { RpcClient, connect } from './client/index'
|
||||||
|
export type { RpcClientOptions, WebSocketAdapter, WebSocketFactory } from './client/index'
|
||||||
|
|||||||
Reference in New Issue
Block a user