dlevs / duration-fns

Functions for working with durations.
MIT License
58 stars 6 forks source link

fix: Publish source files #29

Closed camillef closed 2 years ago

camillef commented 2 years ago

Problem

Source maps are included in the package distribution (since sourceMap is set to true in the tsconfig compilerOptions) but the source files themselves are not. This means the sources field in the source map files is invalid, and Webpack complains by throwing up a bunch of "Failed to parse source map from ..." errors.

Fix

The src files are now included in the published package, which means the paths in the sourcemap files are now valid

Similar fix in the mswjs library: https://github.com/mswjs/interceptors/pull/204

dlevs commented 2 years ago

Thanks for raising this!

It looks like now we don't even need "files" at all, since we're including pretty much all the files in the output anyway with this change. I think we should either:

  1. Delete the "files" property from package.json completely.
  2. OR, be consistent by updating dist/**/* to be just dist.

I'll merge it with either of these changes. Thanks again.

camillef commented 2 years ago

@dlevs Thanks for the feedback - now updated with suggestion 2

dlevs commented 2 years ago

Thanks! I've published that now: https://www.npmjs.com/package/duration-fns/v/3.0.1