Skip to content

@swc/core installing two distributions #1161

@privatenumber

Description

@privatenumber

Describe the bug

When installing @swc/core it seems to install two distributions: @swc/core-linux-x64-musl and @swc/core-linux-x64-gnu, inflating the install size to 100MB+:
https://pkg-size.dev/@swc%2Fcore

I'm wondering if this is a limitation in the environment WebContainers mock, or in swc's postinstall script.

Link to the blitz that caused the error

https://pkg-size.dev/@swc%2Fcore

Sorry, I don't have a Stackblitz reproduction since I wasn't sure how to quickly measure the node_modules size but pkg-size.dev does a plain and simple npm install on WebContainers.

Steps to reproduce

See link

Expected behavior

Locally, when I install @swc/core, it's about 35MB.

Ideally it just installs one distribution.

Parity with Local

Screenshots

No response

Platform

No response

Additional context

privatenumber/pkg-size.dev#21

As a side, wondering how esbuild's postinstall is executed in WebContainers. It felt like there was some custom logic overwriting it to force install the WASM distribution but I wasn't sure. Seems two distributions are installed too: wasm & linux-x64

Is there something swc could do in their postinstall script to play nicely with WebContainers?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions