Bundler Setup

LiteP2P is ESM-first. Most modern bundlers work out of the box. This page covers the few common configuration pitfalls.

Vite

// vite.config.ts
export default {
  optimizeDeps: {
    // if you see dependency optimization warnings, add packages here
    include: ['@litep2p/sdk']
  }
}

Webpack

  • Use Webpack 5+.
  • Ensure your dev server uses HTTPS if required by your WebRTC environment.

Rollup

Prefer ESM builds. If bundling for browsers, ensure WebRTC APIs are available.