next-rspack

Maintain and upgrade @next/rspack-core and @next/rspack-binding packages.

142k|31.8k|Updated Oct 5, 2016
One-click install
npx skills add https://github.com/vercel/next.js --skill next-rspack
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-rspack
Source: https://github.com/vercel/next.js/tree/main/.agents/skills/next-rspack
Command: npx skills add https://github.com/vercel/next.js --skill next-rspack

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Maintaining the Rspack integration in Next.js requires coordinating npm package versions, Rust crate dependencies, and toolchain configurations across an independent workspace. This Skill provides a structured workflow to keep these moving parts in sync and avoid breaking the local build.

Core Features & Use Cases

  • Version Mapping: Translates upstream @rspack/core npm versions to corresponding rspack_* crate versions and Rust nightly toolchain versions.
  • Local Build & Link: Walks through building @next/rspack-core from source and linking it into packages/next-rspack for local testing.
  • Test Execution: Documents the pnpm test-rspack, test-dev-rspack, and test-start-rspack commands and the NEXT_RSPACK environment variable used to differentiate Rspack from Webpack logic.
  • Use Case: When a new Rspack release ships, use this Skill to bump the npm dependency, update Cargo.toml crate versions, refresh the Rust toolchain, rebuild the binding, and run the Rspack test suite.

Quick Start

Upgrade the @rspack/core dependency and rspack crate versions in the rspack workspace, then rebuild and link @next/rspack-core for local testing.

Frequently Asked Questions about next-rspack

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I upgrade @rspack/core in Next.js?

Edit rspack/package.json to update the @rspack/core dependency, then update rspack/crates/binding/Cargo.toml with matching rspack_* crate versions. Finally, update rspack/rust-toolchain.toml to the nightly channel used by upstream Rspack.

What is the version mapping between @rspack/core and rspack crates?

The npm major.minor maps to crate 0.(major*50+minor). For example, @rspack/core 1.3.x corresponds to rspack crates 0.53.x, and 2.0.0-rc.0 corresponds to 0.100.0-rc.0.

How do I run Next.js tests with Rspack?

Build @next/rspack-core in the rspack directory, link it into packages/next-rspack with pnpm link, then run pnpm test-rspack from the repository root. The test commands set NEXT_RSPACK=1 and NEXT_TEST_USE_RSPACK=1 via cross-env.

Does the rspack rust-toolchain.toml apply to Turbopack?

No. The rust-toolchain.toml inside the rspack/ directory only governs the Rspack workspace. The root rust-toolchain.toml is for Turbopack and is outside the scope of this skill.

Why does pnpm test-rspack fail with module not found errors?

The rspack/ directory is an independent workspace not included in the root pnpm-workspace. You must manually link @next/rspack-core into packages/next-rspack and run pnpm install at the root before tests can resolve the binding.