Repository navigation
Add an ESM build to template-sdk - #1485
Open
shubhamkapoor01 wants to merge 1 commit into
Open
shubhamkapoor01 wants to merge 1 commit into
shubhamkapoor01 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🔍 Devin Review: 1 flag
Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The SDK only ships CommonJS, so in a
"type": "module"app Vite 8, bun build and webpack 5 return the whole module for the default import, andEgressHelper.getLiveKitURLis undefined. This adds an ESM build indist/esmplus an exports map, andrequire()still gets the same CommonJS files. Tested the packed SDK in Vite 8, bun and webpack 5 apps (undefined before, a function after) and withrequire().Bumped to 0.3.0, since the exports map closes deep imports like
@livekit/egress-sdk/dist/index.js, and code that hard-coded.defaultas a workaround now gets undefined.The ESM and CommonJS builds are separate copies, so an app that both imports and requires the SDK would get two copies of its room state; templates import it once, so I kept the build simple. template-default installs the SDK from npm, so its CI won't exercise this until 0.3.0 is published, and I can send that bump after the release.
Fixes #1286