
Description
swc-angular is a set of Angular presets that let Jest or Vitest compile Angular TypeScript with SWC (Speedy Web Compiler) instead of the default TypeScript transformer. It is aimed at teams whose test suites are slow mostly because of the transform step rather than the tests themselves. The package gives you a transformer function for Jest and a setup for Vitest, and it depends on the companion @jscutlery/swc-angular-plugin, which adds the Angular-specific transforms that SWC does not do on its own. The project says switching to SWC can make tests two to twelve times faster, and it publishes benchmark data for runs with caches disabled and for cold starts. Setup means installing the preset with npm, pointing your Jest config at its transformer for .ts, .js and .mjs files, and adding reflect-metadata. The source is public in the jscutlery devkit monorepo on GitHub.…
Highlights
- Jest transformer that compiles Angular code with SWC
- Vitest setup using the same SWC presets
- Works together with the swc-angular-plugin
- Project benchmarks show tests two to twelve times faster
- Public source in the jscutlery devkit repository
Ratings & Reviews
No ratings yet
Be the first to rate swc-angular.
People also visit
swc-angular FAQ
What does swc-angular do?
It sets up Jest or Vitest to compile Angular TypeScript with SWC, a fast compiler, instead of the default TypeScript transformer. The project says the transform step is usually the real bottleneck in these test runs.
How much faster are the tests?
The project says switching to SWC can speed up tests by two to twelve times. Its benchmark tables cover runs with all caches disabled and cold starts, and the figures are on the project page.
How do I install it?
Install the preset and its dependencies with npm, then configure your Jest transformer or Vitest setup as the project page describes, and add reflect-metadata. The page has a step-by-step guide for each test runner.
Can it be used to build production apps?
The companion SWC plugin is meant for testing. Its page says it is not a replacement for the Angular compiler and should not be used to build production applications.
Is swc-angular open source?
Yes. The code lives in the jscutlery devkit repository on GitHub, in the packages/swc-angular folder.
What are the best swc-angular alternatives?
Popular alternatives to swc-angular include jest-preset-angular, swc-angular-plugin and @jscutlery/playwright-ct-angular. See all swc-angular alternatives
















