Open maneetgoyal opened 3 years ago
I'm also facing the same problem and since I'm using Create React App then the webpack config is not easily configurable.
I think adding "src" to the "files" array in package.json would fix this (in this package, not as a workaround in consumers of timeago)
This would be useful to reduce the noise created by webpack, any downsides of adding src
files?
You can remove the warning by adding GENERATE_SOURCEMAP=false to your .env file
Actually, CRA with Webpack 5.x cause it. They are working on resolving (https://github.com/facebook/create-react-app/pull/11752)
just for anyone that still lands on this, an alternative library that has a timeago.js-style feature is date-fns https://date-fns.org/
(big thanks to the timeago.js devs, just mentioning :))
Getting the following warning:
Looking at the build routine in
package.json
, this package has:TSC emits source map (
abcd.js.map
) like this:The issue is related to "source" property above. Since
src
folder is missing from the timeago.js NPM distribution, Webpack source-map-loader is throwing warnings.My current solution for the Webpack config is:
which basically tells source-map-loader to ignore parsing the source maps for timeago.js.
Is any other solution suggested? Since end users won't have access to TS source files in the dist, should this library stop distributing source maps altogether?