lazy-load-bindings
Installation
SKILL.md
Lazy-Load Native Bindings for Vite
A pattern and reusable Vite plugin for lazy-loading napi-rs .node native
binaries from the npm registry instead of bundling them. Instead of shipping
every platform's binary in the output bundle, the plugin downloads only the
one matching the current process.platform/process.arch on first use and
caches it on disk.
When to Use This Skill
Use when the user is:
- Bundling a Node.js project with Vite that depends on napi-rs native modules
- Trying to reduce bundle size by removing cross-platform
.nodebinaries - Asking how to download native bindings at runtime from npm
- Working with packages that follow the napi-rs platform-package convention
- Configuring the
lazyLoadBindings()Vite plugin in this project - Adding a new napi-rs dependency and wants it handled the same way