Skip to content

fix: hide sourcemap references in published files - #1074

Open
yadokani389 wants to merge 1 commit into
philihp:mainfrom
yadokani389:main
Open

fix: hide sourcemap references in published files#1074
yadokani389 wants to merge 1 commit into
philihp:mainfrom
yadokani389:main

Conversation

@yadokani389

Copy link
Copy Markdown

Summary

  • Generate hidden sourcemaps with tsdown
  • Keep sourcemaps available in local build output
  • Stop emitting dangling sourceMappingURL annotations

Context

PR #1012 reduced the published package size by externalizing sourcemaps and excluding .map files from the npm package. However, generated JavaScript and declaration files still contained sourceMappingURL annotations pointing to those excluded files.

This caused consumers such as Vite to report missing sourcemap warnings.

Why

Using hidden sourcemaps preserves local debugging support while preventing consumers from requesting files that are not included in the npm package.

Testing

  • pnpm run lint
  • pnpm run typecheck
  • pnpm test
  • pnpm run build
  • Verified that built files contain no sourceMappingURL annotations
  • Verified that the npm package contains neither sourcemap files nor dangling sourcemap references

Generate sourcemaps for local debugging without adding sourceMappingURL annotations to emitted files. This prevents consumers from requesting map files that are intentionally excluded from the npm package.
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.

1 participant