Skip to content

[Packaging]: Decide whether npm releases should include source maps #78

@Fermionic-Lyu

Description

@Fermionic-Lyu

Summary

The npm package currently includes generated source maps for both CJS and ESM bundles. This may be intentional, but it accounts for a large share of the unpacked package size and should have an explicit policy.

Validation

Partially valid. npm --cache /private/tmp/insforge-sdk-npm-cache pack --dry-run --json reported package size 270,990 bytes compressed and 1,205,498 bytes unpacked. The four .map files alone account for roughly 728 KiB.

Relevant Code

  • tsup.config.ts:8 - sourcemap: true.
  • dist/index.js.map - 164,281 bytes in the dry-run package.
  • dist/index.mjs.map - 164,159 bytes in the dry-run package.
  • dist/ssr.js.map - 200,216 bytes in the dry-run package.
  • dist/ssr.mjs.map - 199,200 bytes in the dry-run package.
  • package.json:19 - package publishes dist, so generated maps are included.

Proposed Solution

Decide whether source maps should ship in production npm releases. If yes, document the policy. If not, disable sourcemap generation for publish builds or exclude maps from files.

Acceptance Criteria

  • Package source map policy is explicit.
  • npm pack --dry-run --json output matches the policy.
  • Package size impact is understood and documented if maps remain included.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions