External LibrariesDeploymentOverview

Deployment Overview

Deploy your external library so ReAPI can load it.

Deployment Options

MethodBest ForURL Format
npm + CDNPublic libraries, open sourceunpkg.com/package@version/...
ReAPI CLIPrivate libraries, quick deployslibs.reapi.com/org/...
Self-hostedFull control, air-gappedyour-cdn.com/...

Quick Comparison

Aspectnpm + CDNReAPI CLISelf-hosted
Setupnpm accountReAPI CLICDN/server
PrivacyPublicPrivateYour control
VersioningSemanticAutomaticManual
CDNunpkg/jsdelivrReAPI CDNYour CDN
Best forOSS, shared libsTeam libsEnterprise

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: [...],
    // ...
  };
})();

Next Steps