Include typescript files with npm package for source maps #82
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.
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 thedist
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. 🎉