Skip to content

build: shrink publish ~40% via files allowlist#10939

Merged
jasonsaayman merged 2 commits into
axios:v1.xfrom
JamieMagee:reduce-publish-size
May 24, 2026
Merged

build: shrink publish ~40% via files allowlist#10939
jasonsaayman merged 2 commits into
axios:v1.xfrom
JamieMagee:reduce-publish-size

Conversation

@JamieMagee

@JamieMagee JamieMagee commented May 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Switch from .npmignore to a files allowlist in package.json, and stop shipping the four source maps for the unminified bundles. The .min.js.map files are kept so CDN consumers can still debug.

Linked issue

N/A

Changes

  • Add files to package.json covering index.*, lib/, CHANGELOG.md, MIGRATION_GUIDE.md, and the bundles actually referenced by main / module / exports / jsdelivr / unpkg.
  • Delete .npmignore.
  • Drop dist/axios.js.map, dist/esm/axios.js.map, dist/browser/axios.cjs.map, dist/node/axios.cjs.map from the publish (they mapped a readable bundle back to lib/, which already ships).
Metric Before After Δ
Tarball (gzip) 746,775 B 457,444 B −289 KB (−39%)
Unpacked 2,832,461 B 1,629,526 B −1.20 MB (−42%)
Entries 89 85 −4

Verified with npm pack --dry-run that every entry point still resolves: dist/node/axios.cjs (main), dist/browser/axios.cjs, dist/esm/axios.js, index.js, index.d.ts/index.d.cts, dist/axios.min.js (jsdelivr/unpkg).

Checklist

  • Tests added or updated (or N/A with reason)
    • N/A, publish-shape change only. Verified via npm pack --dry-run.
  • Docs / types updated if public API changed (index.d.ts and index.d.cts)
    • No public API change.
  • No breaking changes (or called out explicitly above)
    • Only the four unminified-bundle source maps stop shipping.

Summary by cubic

Shrink the published package ~40% by switching to a files allowlist and removing unused unminified source maps. Keeps .min.js.map for CDN debugging; all entry points remain unchanged.

Description

  • Switch to package.json files allowlist (include index.js, index.d.ts, index.d.cts, CHANGELOG.md, MIGRATION_GUIDE.md, lib/, dist/axios.js, dist/axios.min.js, dist/axios.min.js.map, dist/esm/axios.js, dist/esm/axios.min.js, dist/esm/axios.min.js.map, dist/browser/axios.cjs, dist/node/axios.cjs); remove .npmignore.
  • Stop publishing unminified source maps: dist/axios.js.map, dist/esm/axios.js.map, dist/browser/axios.cjs.map, dist/node/axios.cjs.map; keep .min.js.map.
  • Size impact: tarball 746,775 B → 457,444 B (~−39%); unpacked 2,832,461 B → 1,629,526 B (~−42%).
  • Verified with npm pack --dry-run that main/module/exports/jsdelivr/unpkg entry points resolve: dist/node/axios.cjs, dist/browser/axios.cjs, dist/esm/axios.js, index.js, index.d.ts/index.d.cts, dist/axios.min.js.
  • Docs: Suggest adding a note in /docs/ about publish contents and that only .min.js.map files are shipped for CDN debugging.
  • Testing & SemVer: No runtime/API changes; publish-shape only. Patch release.

Written for commit 0b13289. Summary will update on new commits. Review in cubic

@JamieMagee JamieMagee requested a review from jasonsaayman as a code owner May 23, 2026 04:37

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@jasonsaayman jasonsaayman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM 🔥

@jasonsaayman jasonsaayman added priority::medium A medium priority commit::refactor The PR is related to refactoring labels May 24, 2026
@jasonsaayman jasonsaayman merged commit bc8ca9f into axios:v1.x May 24, 2026
27 checks passed
@JamieMagee JamieMagee deleted the reduce-publish-size branch May 24, 2026 13:48
jasonsaayman added a commit that referenced this pull request May 28, 2026
…ping unused source maps (#10939)

Co-authored-by: Jay <jasonsaayman@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commit::refactor The PR is related to refactoring priority::medium A medium priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants