Skip to content

Commit a7efd85

Browse files
committed
fix(endpoint-cache): reduce bundle size
mnemonist is a pretty big commonjs package, which is currently included IN FULL from the endpoint-cache package. This is less than ideal when using the sdk on the frontend side, since it adds about 270kb to the bundle (before minification). Since only the LRU-Cache is needed, changing the import to directly target the lru-cache module helps bundlers tree shake correctly, reducing the included code to about 15kb.
1 parent 6fa9c67 commit a7efd85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/endpoint-cache/src/EndpointCache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { LRUCache } from "mnemonist";
1+
import LRUCache from "mnemonist/lru-cache";
22

33
import { Endpoint } from "./Endpoint";
44

0 commit comments

Comments
 (0)