-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support installing binaries for multiple platforms #2898
Comments
@iacobfred Sorry, |
Resolved it by adding it as optional dependency:
|
It looks like esbuild already supports this behaviour i think by the way they generate their postinstall install.js file It would be great if we could fix this to support multiplatform zero installs with yarn berry |
update Looks like it does work as long as you specify all of supportedArchitectures details in your .yarnrc.yml not just say os e.g.
will install Initially hadn't specified glibc and the linux optional dep wouldn't install It'd be great if this could support zero installs based on the supportedArchitectures |
I'm inclined to leave this to upstream support : npm/rfcs#612 Techinincally instead of the way swc/core currently distributes binary (optionalDependencies) we could implement own download logics, but that's not an easy to get it right without error. As commented yarn have support, and if npm got an equivalent support this'll be resolved naturally. |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Describe the feature
It would be great if SWC could optionally be installed for multiple platforms at the same time by specifying the binary targets (e.g., MacOS and Linux).
My use case: I have a NextJS application running in Docker. In dev environment, I use a volume for
node_modules
so that when I install a package in the project on my MacBook, the package is also added in the development container without me having to rebuild the container or run something likedocker compose exec nextjs npm i <package>
. This has worked well for me and is very convenient. However, currently, it does not work for SWC; if I runnpm i -D @swc/cli @swc/core
on my MacBook, it uses the binary for MacOS, so the Linux-based container does not get what it needs.Here's an example of a similar feature that I use for Prisma:
https://www.prisma.io/docs/concepts/components/prisma-schema/generators#binary-targets
Babel plugin or link to the feature description
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: