googlemaps / googlemaps/google-maps-services-js

Add `"sideEffects": false` to `package.json`

Open
#1,021 3 comments 0 reactions 0 assignees View on GitHub
type: feature request
Dominant language
TypeScript
Stars
3.1k
Forks
654
Avg merge
3m
Merged PRs (30d)
4

Description

**Is your feature request related to a problem? Please describe.**
Without this field, certain bundlers (namely ESBuild) don't know if they tree-shake this package correctly, so they'll leave it in just in case. In my Remix project, this causes a 1.5MB `node:crypto` polyfill to be included in the bundle for no reason.
![Screenshot from 2023-08-15 11-07-19](https://github.com/googlemaps/google-maps-services-js/assets/12158785/4565a0e9-1e11-4aa6-9a1d-a4045f536810)

**Describe the solution you'd like**
Simply adding `"sideEffects": false` to the `package.json` is enough to fix it. I've tested this with [`patch-package`](https://www.npmjs.com/package/patch-package) and everything works perfectly.

**Describe alternatives you've considered**
N/A

**Additional context**
I'd make a pull-request, but I'd imagine it's easier to have someone on the team do it than to have to do the whole CLA song and dance.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.