docs.rs failed to build rspack-0.7.0-beta.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: rspack-0.6.4

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.

For guide level documentation, please refer to the Rspack Guide.

Example

Rspack uses tokio as the runtime for async operations. Here's an example of how to use with Compiler:

[dependencies]
tokio = { version = "1", features = ["full"] }
rspack = "0.3"
rspack_core = "0.3"
use std::path::PathBuf;

use rspack::builder::{Builder, CompilerBuilder};
use rspack_core::Compiler;

#[tokio::main]
async fn main() {
  use rspack_tasks::within_compiler_context_for_testing_sync;
  within_compiler_context_for_testing_sync(|| {
    let context =
      PathBuf::from(env!("CARGO_MANIFEST_DIR").to_string()).join("tests/fixtures/basic");
    let compiler = Compiler::builder()
      .context(context)
      .entry("main", "./src/index.js")
      .build()
      .unwrap();

    let errors: Vec<_> = compiler.compilation.get_errors().collect();
    assert!(errors.is_empty());
  })
}

Stability

This crate and the dependencies that this crate are relying on are not stable yet. The API may change at any time. We do not guarantee any backward compatibility at the moment.

Features

Currently, there's still alot of features that are not implemented yet. Here's a list of features that are not implemented yet:

  • CompilerBuilder API
  • SplitChunksPlugin API
  • BundlerInfoPlugin API
  • StatsPrinter API
  • Stable Compiler API
  • Stable Compilation API
  • Rust Plugin for Rspack
  • ...

To track the current stats for API, please refer to this GitHub issue.