You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please, check for existing issues to avoid duplicates.
No similar issues found.
What happened?
Hi, I noticed that the whole package.json is bundled in the distributed output of this library, including cjs, mjs, browser unminified and browser minified versions. This increases the size of this package and all downstream packages and apps unnecessarily, and expose metadata, including a long list of scripts, dependency names, and contributor emails, that isn't needed at runtime.
Parcel can't treeshake this, even though it is ES module import. I guess many bundle tools can't, or intentionally don't treeshake such JSON file import, and include the whole JSON file content in the final output.
I'll create a PR
The text was updated successfully, but these errors were encountered:
Using parcel's `inlineEnvironment` parcel-bundler/parcel#8470 (comment) to inline the version so the whole package.json content is not included in the bundle
Must use `"context": "browser"` for targets.main and targets.module, default context "node" can't inline `process.env.npm_package_version`
Added @types/node for `process`'s type definition
Closespeers#1322
Please, check for existing issues to avoid duplicates.
What happened?
Hi, I noticed that the whole package.json is bundled in the distributed output of this library, including cjs, mjs, browser unminified and browser minified versions. This increases the size of this package and all downstream packages and apps unnecessarily, and expose metadata, including a long list of scripts, dependency names, and contributor emails, that isn't needed at runtime.
How can we reproduce the issue?
In https://unpkg.com/peerjs/dist/peerjs.min.js, search something like "contributors" or other keywords that appear in the package.json
What do you expected to happen?
Not include the whole package.json in the bundles
Environment setup
Any platform
peerjs v1.5.4 (latest), all cjs, mjs, browser unminified and browser minified versions
Is this a regression?
No response
Anything else?
It's due to these two:
peerjs/lib/api.ts
Line 4 in c073252
peerjs/lib/socket.ts
Line 4 in c073252
Parcel can't treeshake this, even though it is ES module import. I guess many bundle tools can't, or intentionally don't treeshake such JSON file import, and include the whole JSON file content in the final output.
I'll create a PR
The text was updated successfully, but these errors were encountered: