Replies: 3 comments 3 replies
-
Some things that would make Bazel integration better:
@gregmagolan has some other observations around the command-line API, in particular that only a single file or a single directory can be transpiled |
Beta Was this translation helpful? Give feedback.
-
I personally would like to support this. I'd frame this as somewhat meta like supporting integration with build tools in general where its characteristics meets well with what SWC can do best. Each individual support may require some discussions if we'd like to support & how, but most of the items in existing list seems non-breaking, good to have changes. |
Beta Was this translation helpful? Give feedback.
-
Next one that makes Bazel usage harder: the output paths with |
Beta Was this translation helpful? Give feedback.
-
Bazel (https://bazel.build) is an incremental, full-stack build and test tool from Google. It is polyglot and works with most languages. I think there's an opportunity for Bazel and SWC to benefit each other.
SWC is a natural fit with Bazel. Bazel does best when it orchestrates the work of many short-lived compiler processes.
NodeJS is not a good runtime for such tools, because it is an interpreter, and is only fast after the code has been running for a while and is Just-In-Time optimized.
SWC is fast from the beginning since it is compiled to optimized machine code.
This makes it a particularly better choice under Bazel for tools like
tsc
orbabel
, which have to have clumsy workarounds to run in a "watch-mode" for performance.At the same, Bazel is a good fit for SWC too. It has still-developing features like a bundler,
but you might want to use something else as a bundler, like esbuild.
Bazel's agnostic unix-pipeline-style composition of tools allows you to mix-and-match the best parts of
the JS ecosystem, regardless what language they run on.
With Bazel, you won't need to figure out SWC's plugin infrastructure.
You can have SWC do what it's good at, and not even have it involved with the rest.
I already wrote the Bazel plugin (called "rules") https://github.com/aspect-build/rules_swc and am rolling out to some clients, so there's not a lot of work to do here 😁
Beta Was this translation helpful? Give feedback.
All reactions