Include src files in package to resolve source map warnings#5710
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5710 +/- ##
=======================================
Coverage 97.12% 97.12%
=======================================
Files 30 30
Lines 3374 3374
Branches 1427 1424 -3
=======================================
Hits 3277 3277
Misses 95 95
Partials 2 2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Is this PR going to get reviewed? I've been getting these warnings too, and was quite pleased to see that @John-Youngblood had already opened this PR. |
|
Seconded, will this get merged any time soon? Annoying warning. |
|
I am waiting this fix too |
|
I hope this will be merged soon 🤞 |
|
Fairly new to actually get a response from a maintainer on a package update, is there a set release cadence for bringing this change out into a new release? |
|
@martijnrusschen can we please get a new release because of this? |
name: Include src files in package
about: Include src files in package to resolve source map warnings
title: "Include src files in package to resolve source map warnings"
labels: "bug"
assignees: "martijnrusschen"
Description
Linked issue: #5416
Problem
The published
npmpackage includes source maps in the/distfolder that point to original source files in a/srcdirectory. However, the/srcdirectory itself is not included in the published package, causingsource-map-loaderto fail with anENOENTerror.Changes
This PR updates the build configuration to correctly generate and include source maps. This resolves the common "Failed to parse source map" warnings for developers using the library in modern bundlers. The main changes include updating
rollup.config.mjsto enable source map generation for all outputs and modifyingpackage.jsonto include the/srcdirectory in the published package.To reviewers
Here are the steps I used to verify changes:
yarn buildyarn packtar -tvf package.tgz | grep "src/"This PR does increase the package size from ~375kb to ~499kb due to additional source files included in the package. These source files are used for development-time debugging only and are not included in the final production builds of applications that use
react-datepicker, so there is no impact on end-user application size or performance.Contribution checklist