Skip to content

Conversation

aarsilv
Copy link
Contributor

@aarsilv aarsilv commented Jun 11, 2024

Eppo Internal:
🎟️ Ticket: FF-2395 - JS Common SDK - Include TS source with package
🗨️ Slack: "...The first issue is when running our web client app locally with a webpack dev server, the @eppo/js-client-sdk and @eppo/js-client-sdk-common outputs a lot of warnings..."(https://eppo-group.slack.com/archives/C06TTCBDRU4/p1717092945766289?thread_ts=1717091604.044459&cid=C06TTCBDRU4)

Description

When using source-map-loader with Wepback, it throws many warnings because it cannot map back to the TypeScript source with what is provided in the dist directory.

To fix this, we include a subset of the src/ directory for the source mapping function.

When a downstream application is building a production bundle, the extra source files and maps should be left out as they are not used by the entry point.

This change both resulted in the warnings disappearing in a test webpack project, as well as TypeScript sources working in Chrome. 🎉

image

@aarsilv aarsilv marked this pull request as ready for review June 11, 2024 23:05
@aarsilv aarsilv requested a review from sameerank June 11, 2024 23:06
@aarsilv aarsilv assigned aarsilv and unassigned greghuels Jun 11, 2024
@aarsilv aarsilv merged commit e306d54 into main Jun 11, 2024
@aarsilv aarsilv deleted the aaron/ff-2395/include-ts-in-dist branch June 11, 2024 23:08
@felipecsl
Copy link
Contributor

have we thought about migrating to ESM? ("type": "module") - I wonder if that would help alleviate some of these issues

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.

3 participants