rspack/lib.rs
1#![forbid(missing_docs)]
2
3//! Rspack is a high performance JavaScript bundler written in Rust. It offers strong compatibility with the webpack ecosystem, allowing for seamless replacement of webpack, and provides lightning fast build.
4//!
5//! For guide level documentation, please refer to the [Rspack Guide](https://rspack.rs/guide/start/introduction).
6//!
7//! ## Example
8//!
9//! Rspack uses [`tokio`](https://docs.rs/tokio) as the runtime for async operations. Here's an example of how to use with `Compiler`:
10//!
11//! ```toml
12//! [dependencies]
13//! tokio = { version = "1", features = ["full"] }
14//! rspack = "0.3"
15//! rspack_core = "0.3"
16//! ```
17//!
18//! ```
19//! use std::path::PathBuf;
20//!
21//! use rspack::builder::{Builder, CompilerBuilder};
22//! use rspack_core::Compiler;
23//!
24//! #[tokio::main]
25//! async fn main() {
26//! use rspack_tasks::within_compiler_context_for_testing_sync;
27//! within_compiler_context_for_testing_sync(|| {
28//! let context =
29//! PathBuf::from(env!("CARGO_MANIFEST_DIR").to_string()).join("tests/fixtures/basic");
30//! let compiler = Compiler::builder()
31//! .context(context)
32//! .entry("main", "./src/index.js")
33//! .build()
34//! .unwrap();
35//!
36//! let errors: Vec<_> = compiler.compilation.get_errors().collect();
37//! assert!(errors.is_empty());
38//! })
39//! }
40//! ```
41//!
42//! ## Stability
43//!
44//! This crate and the dependencies that this crate are relying on are not stable yet. The API may change at any time.
45//! We do not guarantee any backward compatibility at the moment.
46//!
47//! ## Features
48//!
49//! Currently, there's still alot of features that are not implemented yet. Here's a list of features that are not implemented yet:
50//!
51//! - [x] `CompilerBuilder` API
52//! - [ ] `SplitChunksPlugin` API
53//! - [ ] `BundlerInfoPlugin` API
54//! - [ ] `StatsPrinter` API
55//! - [ ] Stable `Compiler` API
56//! - [ ] Stable `Compilation` API
57//! - [ ] Rust Plugin for Rspack
58//! - [ ] ...
59//!
60//!
61//!
62//! To track the current stats for API, please refer to [this](https://github.com/web-infra-dev/rspack/issues/9378) GitHub issue.
63pub mod builder;