Deployment Overview
Deploy your external library so ReAPI can load it.
Deployment Options
| Method | Best For | URL Format |
|---|---|---|
| npm + CDN | Public libraries, open source | unpkg.com/package@version/... |
| ReAPI CLI | Private libraries, quick deploys | libs.reapi.com/org/... |
| Self-hosted | Full control, air-gapped | your-cdn.com/... |
Quick Comparison
| Aspect | npm + CDN | ReAPI CLI | Self-hosted |
|---|---|---|---|
| Setup | npm account | ReAPI CLI | CDN/server |
| Privacy | Public | Private | Your control |
| Versioning | Semantic | Automatic | Manual |
| CDN | unpkg/jsdelivr | ReAPI CDN | Your CDN |
| Best for | OSS, shared libs | Team libs | Enterprise |
Requirements
All deployment methods produce the same output:
dist/
├── build.umd.js # IIFE/UMD bundle (required)
└── build.d.ts # TypeScript types (optional)Bundle Requirements
- Format: IIFE or UMD (not ESM)
- Global: Must expose a global variable
- CORS: URL must allow cross-origin requests
- HTTPS: Production URLs should use HTTPS
Build Output
The template generates both files:
npm run build
# Output:
# dist/build.umd.js (123 KB)
# dist/build.d.ts (4 KB)Verify the Bundle
// Check global is exposed
// dist/build.umd.js should contain:
var MyTestLib = (function() {
// ... bundled code
return {
$$AssertionFunctions: [...],
$$ValueFunctions: [...],
// ...
};
})();