Skip to content

Don’t publish sourcemaps #2866

@jkwlui

Description

@jkwlui

About

Source maps to google typescript source are shipped with npm publish into installable tarballs.

When a user runs code in an environment that enables source maps their stack traces end in code that doesn't exist.

This creates a very difficult situation for common types of user debugging. For example, inserting a console.log in the javascript to find out why an interaction with a google library failing.

There is no reasonable way for end users to map typescript lines to javascript lines. Reverse source maps are not available as far as I know.

Implementation

In the package.json files array. Replace "build/src" with "build/src/!(*.map)":

"files": [
  "build/src/!(*.map)"
  ...
]

Metadata

Metadata

Assignees

Labels

type: cleanupAn internal cleanup or hygiene concern.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions