Skip to content

Fix grunt build rebundling existing dist via browser field - #971

Merged
jonkoops merged 1 commit into
Stuk:mainfrom
jonkoops:fix-grunt-browser-build
Sep 8, 2026
Merged

jonkoops merged 1 commit into
Stuk:mainfrom
jonkoops:fix-grunt-browser-build

Conversation

@jonkoops

@jonkoops jonkoops commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

grunt build runs browserify on lib/index.js, but package.json maps ./lib/index to ./dist/jszip.min.js. Browserify followed that mapping and rebundled the existing dist, so changes under lib/ never reached dist/jszip.js.

That showed up in CI as failing browser tests for source-only fixes. Node tests import lib/ directly, so they passed. Browser tests load dist/jszip.js, and npm run test-browser runs grunt build first. Because the rebuild never picked up lib/ changes, the browser suite was still exercising the old bundle.

This change temporarily removes that mapping during the build and restores package.json afterward. The release docs no longer describe doing that manually.

The package.json browser mapping for ./lib/index points browserify at
dist/jszip.min.js, so grunt build inlined the existing bundle instead
of walking lib/. Temporarily remove that mapping during the build and
restore package.json afterward.

Signed-off-by: Jon Koops <jonkoops@gmail.com>
@jonkoops
jonkoops requested a review from Stuk September 8, 2026 17:04
@jonkoops
jonkoops merged commit e682f9a into Stuk:main Sep 8, 2026
23 checks passed
jonkoops added a commit that referenced this pull request Sep 8, 2026
Release preparation for 3.10.2

- Fix cross-realm binary type detection in `getTypeOf`. Fixes
[#759](#759) (see
[#578](#578))
- Add missing types for `JSZip.defaults`. Fixes
[#690](#690) (see
[#927](#927))
- Fix Blob support in Node.js 18 and up. Fixes
[#941](#941) (see
[#955](#955))
- Fix grunt build rebundling existing dist via browser field (see
[#971](#971))
- Move all continuous integration to GitHub Actions (see
[#942](#942))
- Upgrade Playwright to the latest version (see
[#940](#940))
- Create FUNDING.yml

Signed-off-by: Jon Koops <jonkoops@gmail.com>
@jonkoops
jonkoops deleted the fix-grunt-browser-build branch September 8, 2026 22:33
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.

2 participants