Frequently Asked Questions

Everything you need to know about SWC

Find answers to common questions about SWC, the super-fast TypeScript/JavaScript compiler written in Rust.

Common Questions About SWC

Getting Started

What is SWC?

SWC (Speedy Web Compiler) is a super-fast TypeScript/JavaScript compiler written in Rust. It's designed to be significantly faster than alternatives like Babel while maintaining compatibility and offering additional features. SWC provides both a Rust library and JavaScript bindings, making it accessible to both Rust and JavaScript developers.

How do I install SWC?

Installation depends on your use case:

  • For JavaScript projects: Install via npm: npm install @swc/core
  • For Rust projects: Add to your Cargo.toml: swc = "version"
  • As a CLI tool: npm install @swc/cli

For detailed installation instructions, visit our documentation.

What are the system requirements?
  • Usage: Node.js v10 or higher
  • Development: Node.js v20 or higher
  • Rust: Minimum Supported Rust Version (MSRV) is 1.73
  • Operating Systems: Windows, macOS, Linux

Features & Compatibility

What languages and features does SWC support?

SWC supports:

  • JavaScript (ES3+)
  • TypeScript
  • JSX
  • Flow
  • React, Vue, and other popular frameworks
  • Minification
  • Bundling (with SWC plugins)
  • Tree-shaking
  • Source maps
  • And many more transformation features
How does SWC compare to Babel?

SWC offers several advantages over Babel:

  • Performance: SWC is significantly faster (10-100x) due to Rust implementation
  • Memory Usage: Lower memory consumption
  • Babel Compatibility: SWC aims to be Babel-compatible, making migration easier
  • Additional Features: Built-in bundling and minification capabilities
  • Plugin System: Extensible architecture for custom transformations

For a detailed comparison, see our Babel migration guide.

Can I use SWC with my existing build tool?

Yes! SWC integrates with popular build tools:

  • Webpack: Use @swc/webpack loader
  • Rollup: Use @rollup/plugin-swc
  • Vite: Use vite-plugin-swc
  • Next.js: SWC is the default compiler in Next.js
  • Create React App: Use craco or eject to customize

Performance & Technical Details

How much faster is SWC compared to alternatives?

SWC is significantly faster than JavaScript-based compilers:

  • 10-100x faster than Babel for many operations
  • 50-70% faster than TypeScript compiler
  • Lower memory usage during compilation
  • Better parallelization capabilities

For benchmark results, see our performance benchmarks.

What makes SWC so fast?

The performance advantages come from several factors:

  • Rust implementation: Compiled to native code for optimal performance
  • Parallel processing: Utilizes multiple CPU cores efficiently
  • Minimal runtime overhead: Less JavaScript runtime needed
  • Optimized parser: Highly efficient parsing algorithms
  • Memory efficient: Better memory management compared to JavaScript
Can I use SWC for production builds?

Yes! SWC is production-ready and used by many large-scale projects. It has been thoroughly tested and is:

  • Stable and reliable: Used in production by companies like Vercel, ByteDance, and others
  • Actively maintained: Regular updates and improvements
  • Well-tested: Comprehensive test suite
  • Battle-tested: Used in high-traffic applications

Development & Contributing

How can I contribute to SWC?

Contributions are welcome! Here are several ways to help:

  • Code contributions: Fix bugs, implement new features, or improve performance
  • Documentation: Help improve our documentation and guides
  • Testing: Write tests or help with existing test coverage
  • Community support: Help others on Discord or GitHub Discussions

Start by reading our contributing guidelines.

How do I report bugs or request features?

Bugs and feature requests can be submitted through:

Please provide detailed information when reporting issues, including steps to reproduce, expected behavior, and actual behavior.

What is the architecture of SWC?

SWC is built with a modular architecture:

  • Parser: Converts source code to an AST
  • Transformer: Applies transformations to the AST
  • Code Generator: Transforms AST back to code
  • Plugin System: Extensible architecture for custom transformations
  • Bindings: JavaScript bindings for easy integration

For detailed architecture information, see our architecture documentation.

Support & Community

How can I get help with SWC?

There are several ways to get help:

How can I sponsor SWC development?

You can support SWC development through:

  • OpenCollective: Become a sponsor on OpenCollective
  • GitHub Sponsors: Sponsor individual maintainers
  • Direct contributions: Contribute code or documentation
  • Community support: Help others in the community

All sponsors are recognized on our website and GitHub repository.

What is the license for SWC?

SWC is primarily distributed under the Apache License 2.0, which is a permissive open-source license that allows:

  • Commercial use
  • Modification
  • Distribution
  • Private use

For full license details, see the LICENSE file in the repository.

33,882
Stars on GitHub
1,411
Forks
175
Subscribers
405
Open Issues
Rust
Language