Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add ESM support for common and sdk-client. #603

Closed
wants to merge 4 commits into from

Conversation

kinyoklion
Copy link
Member

@kinyoklion kinyoklion commented Oct 2, 2024

This PR uses TSC to build both an ESM and CJS version of common and sdk-client.

I was going to use rollup for this, but removing rollup provides more debuggable code for non-browser cases. The browser build can do the minification.

@@ -13,11 +13,6 @@ const getSharedConfig = (format, file) => ({
file: file,
},
],
onwarn: (warning) => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had copied this config and this onwarn thing was a big problem. First there should not be circular references, but second it meant the logging left out all the useful stuff. Like where the error happened. Which made all errors not useful at all.

Platform,
} from '@launchdarkly/js-client-sdk-common';
import { LDIdentifyOptions } from '@launchdarkly/js-client-sdk-common/dist/api/LDIdentifyOptions';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Building the new way helps find these bad imports.

@kinyoklion kinyoklion closed this Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant