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.
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 --jsonreported package size270,990bytes compressed and1,205,498bytes unpacked. The four.mapfiles 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 publishesdist, 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
npm pack --dry-run --jsonoutput matches the policy.