parcel-bundler / parcel

The zero configuration build tool for the web. 📦🚀
https://parceljs.org
MIT License
43.37k stars 2.26k forks source link

published transformer-js package contains 150MiB of swc binaries #8995

Open legobeat opened 1 year ago

legobeat commented 1 year ago

🐛 bug report

As of @parcel/transformer-js@2.0.0-nightly.657 (ba57b6501632703d68923b214b0c0f6d47a34b1f), the published npm package contains prebuilt swc binaries for 8 platforms. In the latest version of the package, these add up to 150 MiB.

I tried searching for mentions of this being a conscious decision but coming up short, this issue asks if there are changes that can be done in bundling to bring the installation size of this package down.

4.0K    package/LICENSE
4.0K    package/native-browser.js
4.0K    package/native.js
4.0K    package/package.json
40K package/src
48K package/lib
17M package/parcel-swc.linux-arm-gnueabihf.node
18M package/parcel-swc.darwin-arm64.node
18M package/parcel-swc.linux-arm64-gnu.node
18M package/parcel-swc.linux-arm64-musl.node
19M package/parcel-swc.darwin-x64.node
20M package/parcel-swc.linux-x64-musl.node
21M package/parcel-swc.linux-x64-gnu.node
23M package/parcel-swc.win32-x64-msvc.node

🤔 Expected Behavior

I can use have a bunch of isolated gatsby environments checked out side-by-side an a consumer-grade laptop.

😯 Current Behavior

The node_modules directories fill up the disk quickly.

💁 Possible Solution

Build locally (node-gyp approach) as lifecycle script?

mischnic commented 1 year ago

Yes, this should be fixed.

Build locally (node-gyp approach) as lifecycle script?

We should do the same as swc/lightningcss/esbuild: one npm package per platform as optionalDependencies: https://unpkg.com/browse/lightningcss@1.20.0/package.json

legobeat commented 10 months ago

Not stale

ankurparihar commented 7 months ago

yeah, this is huge file, which is causing problems when doing npm i from our self hosted artifactory, please resolve this, open to contribute if someone can mentor.

~/workspace $ du -h package 44K package/lib 36K package/src 137M package ~/workspace $ du -h trans.tgz 44M trans.tgz

legobeat commented 1 month ago

bump