This is a monorepo containing both Rust crates and JavaScript packages:
crates/)rspack: Main crate that integrates all core functionality and plugins, providing the complete build tool entry pointrspack_core: Core engine containing module system, dependency graph, compilation pipeline, and other core functionalityrspack_binding_api: Node.js binding API that bridges Rust core functionality to JavaScript/TypeScript interfacesnode_binding: Node.js binding implementation that generates Node.js native modulesrspack_napi: NAPI (Node-API) support layer for interoperability between Rust and Node.jsrspack_allocator: Memory allocator using mimalloc to optimize memory allocation performance (Linux/macOS)rspack_binding_build: Binding build script for building Node.js native bindingsrspack_binding_builder: Binding builder for generating custom Rspack bindingsrspack_binding_builder_macros: Binding builder macros providing procedural macro supportrspack_binding_builder_testing: Binding builder testing utilitiesrspack_error: Error handling and formatting, providing user-friendly error messagesrspack_fs: File system abstraction layer providing cross-platform file operation interfacesrspack_paths: Path utilities for path normalization, resolution, and manipulationrspack_hash: Hash algorithm implementations supporting MD4, SHA2, xxhash, etc.rspack_regex: Regular expression utilities providing high-performance regex matchingrspack_location: Location information handling for source code position trackingrspack_ids: ID generation and management for creating unique identifiers for modules, chunks, etc.rspack_collections: Collection data structures providing optimized HashMap, HashSet, etc.rspack_util: Utility function collection containing various helper functionsrspack_futures: Async utilities providing asynchronous programming supportrspack_workspace: Workspace support for handling monorepo scenariosrspack_cacheable: Caching system providing serialization and deserialization for cacheable datarspack_cacheable_macros: Caching system macros for auto-generating cache-related coderspack_cacheable_test: Caching system testsrspack_storage: Storage abstraction layer providing persistent storage interfacesrspack_hook: Hook system implementing plugin hook registration and invocation mechanismsrspack_macros: Procedural macros providing various compile-time code generation featuresrspack_macros_test: Macro system testsrspack_javascript_compiler: JavaScript compiler for processing JS/TS code compilationrspack_loader_runner: Loader runner for executing various loaders to process resourcesrspack_loader_swc: SWC loader using SWC for code transformationrspack_loader_lightningcss: Lightning CSS loader for processing CSS filesrspack_loader_react_refresh: React Fast Refresh loader supporting React hot module replacementrspack_loader_preact_refresh: Preact Refresh loader supporting Preact hot module replacementrspack_loader_testing: Loader testing utilitiesrspack_plugin_javascript: JavaScript plugin for parsing, transforming, and code generation of JS/TS modulesrspack_plugin_runtime: Runtime plugin generating webpack-compatible runtime coderspack_plugin_entry: Entry plugin for handling entry point configurationrspack_plugin_dynamic_entry: Dynamic entry plugin supporting dynamic entry pointsrspack_plugin_asset: Asset plugin for processing static assetsrspack_plugin_copy: Copy plugin for copying files to output directoryrspack_plugin_json: JSON plugin for processing JSON filesrspack_plugin_wasm: WebAssembly plugin for processing WASM modulesrspack_plugin_html: HTML plugin for generating HTML filesrspack_plugin_css: CSS plugin for processing CSS modules and stylesrspack_plugin_extract_css: CSS extraction plugin for extracting CSS to separate filesrspack_plugin_css_chunking: CSS code splitting pluginrspack_plugin_lightning_css_minimizer: Lightning CSS minifier pluginrspack_plugin_swc_js_minimizer: SWC JavaScript minifier pluginrspack_plugin_split_chunks: Code splitting plugin implementing chunk splitting strategiesrspack_plugin_merge_duplicate_chunks: Merge duplicate chunks pluginrspack_plugin_remove_empty_chunks: Remove empty chunks pluginrspack_plugin_remove_duplicate_modules: Remove duplicate modules pluginrspack_plugin_limit_chunk_count: Limit chunk count pluginrspack_plugin_real_content_hash: Real content hash plugin generating hashes based on contentrspack_plugin_hmr: Hot Module Replacement (HMR) pluginrspack_plugin_devtool: Source Map plugin for generating source mapsrspack_plugin_progress: Progress display pluginrspack_plugin_lazy_compilation: Lazy compilation pluginrspack_plugin_library: Library plugin for generating library filesrspack_plugin_esm_library: ESM library plugin for generating ES module format librariesrspack_plugin_externals: Externals plugin for excluding external dependenciesrspack_plugin_module_replacement: Module replacement plugin supporting module aliasesrspack_plugin_ignore: Ignore plugin for ignoring specific modulesrspack_plugin_mf: Module Federation plugin implementing micro-frontend module federationrspack_plugin_dll: DLL plugin implementing dynamic link library functionalityrspack_plugin_worker: Web Worker plugin for processing Worker filesrspack_plugin_web_worker_template: Web Worker template pluginrspack_plugin_schemes: Custom scheme plugin supporting custom resource protocolsrspack_plugin_runtime_chunk: Runtime chunk plugin for separating runtime coderspack_plugin_ensure_chunk_conditions: Ensure chunk conditions pluginrspack_plugin_no_emit_on_errors: No emit on errors pluginrspack_plugin_circular_dependencies: Circular dependency detection pluginrspack_plugin_banner: Banner plugin for adding file header commentsrspack_plugin_size_limits: Size limits plugin for checking bundle sizesrspack_plugin_sri: Subresource Integrity (SRI) pluginrspack_plugin_module_info_header: Module info header pluginrspack_plugin_warn_sensitive_module: Warn sensitive module pluginrspack_plugin_rsdoctor: RsDoctor plugin providing debugging and diagnostic functionalityrspack_plugin_rslib: RsLib plugin for library buildsrspack_plugin_rstest: RsTest plugin for testingrspack_browser: Browser environment support providing browser-side implementationsrspack_browserslist: Browserslist support for handling browser compatibility queriesrspack_tracing: Tracing system providing performance tracing functionalityrspack_tracing_perfetto: Perfetto tracing support integrating Perfetto performance analysis toolsrspack_watcher: File watcher monitoring file changes to trigger rebuildsrspack_tasks: Task system for managing build tasksswc_plugin_import: SWC import plugin for processing module import transformationsswc_plugin_ts_collector: SWC TypeScript collector plugin for collecting TS type informationpackages/)@rspack/core: Main JavaScript/TypeScript package that provides webpack-compatible API, wrapping the Rust core functionality and exposing the complete build tool interface for Node.js applications@rspack/cli: Command-line interface providing build, serve, and preview commands for running Rspack from the terminalcreate-rspack: Project scaffolding tool for creating new Rspack projects with various templates (vanilla, React, Vue) supporting both JavaScript and TypeScript@rspack/browser: Browser-compatible version of Rspack that can run in browser environments using WebAssembly, currently in early development stage@rspack/test-tools: Testing utilities and helper functions for writing and running Rspack tests, including support for WebAssembly test executiontests/)rspack-test/)The main test suite for Rspack core functionality, containing various test types that simulate the build process:
normalCases/ (Normal.test.js, Normal-dev.test.js, Normal-hot.test.js, Normal-prod.test.js): Test cases for core build processes without configuration changes, used when testing does not require rspack.config.jsconfigCases/ (Config.part1.test.js, Config.part2.test.js, Config.part3.test.js): Test cases for build configuration options, allowing specification of build configuration through rspack.config.js and test behavior through test.config.jshotCases/ (HotNode.test.js, HotWeb.test.js, HotWorker.test.js, HotSnapshot.hottest.js): Test cases for Hot Module Replacement (HMR) functionality, including HotNode (target=async-node), HotWeb (target=web), and HotWorker (target=webworker)watchCases/ (Watch.part1.test.js, Watch.part2.test.js, Watch.part3.test.js): Test cases for incremental compilation in Watch mode, using numbered directories (0, 1, 2...) to represent change batchesstatsOutputCases/ (StatsOutput.test.js): Test cases for console output logs after build completion, with snapshots stored in __snapshots__/StatsOutput.test.js.snapstatsAPICases/ (StatsAPI.test.js): Test cases for the Stats object generated after build completion, using tests/rspack-test/fixtures as source codediagnosticsCases/ (Diagnostics.test.js): Test cases for formatted warning/error output during the build process, with snapshots stored in stats.err fileshashCases/ (Hash.test.js): Test cases for hash generation functionality, validating hash information in the Stats objectcompilerCases/ (Compiler.test.js): Test cases for Compiler/Compilation object APIs, using tests/rspack-test/fixtures as source codedefaultsCases/ (Defaults.test.js): Test cases for configuration option interactions, generating build configurations and observing differences from defaultserrorCases/ (Error.test.js): Test cases for compilation.errors and compilation.warnings interactionshookCases/ (Hook.test.js): Test cases for various hook functionalities, recording hook input/output in snapshotstreeShakingCases/ (TreeShaking.test.js): Test cases for Tree Shaking-related features, with product snapshots stored in __snapshots__/treeshaking.snap.txtbuiltinCases/ (Builtin.test.js): Test cases for plugins with built-in native implementations, generating different snapshots based on plugin type (CSS, CSS modules, HTML, JavaScript)cacheCases/ (Cache.test.js): Test cases for caching functionality, including common cache, invalidation, snapshot, storage, and portable cache scenariosserialCases/ (Serial.test.js): Test cases for serial execution scenariosexampleCases/ (Example.test.js): Example test cases demonstrating various Rspack featuresesmOutputCases/ (EsmOutput.test.js): Test cases for ES module output functionality, including basic output, deconflict, dynamic import, externals, interop, namespace, preserve-modules, re-exports, and split-chunks scenariosmultiCompilerCases/ (MultiCompiler.test.js): Test cases for multi-compiler scenariosIncremental-node.test.js, Incremental-async-node.test.js, Incremental-web.test.js, Incremental-webworker.test.js, Incremental-watch.test.js): Test cases for incremental compilation targeting different environmentsNativeWatcher.part1.test.js, NativeWatcher.part2.test.js, NativeWatcher.part3.test.js): Test cases for native file watcher functionalityfixtures/: General test files and shared fixtures used across multiple test typesjs/: Build artifacts and temporary files generated during test execution, organized by test type (e.g., js/normal, js/config, js/hot-{target})__snapshots__/: Test snapshots for various test types, including StatsOutput, HotSnapshot, and other snapshot-based testse2e/)End-to-end tests for Rspack, covering real-world scenarios and integration testing:
cases/: E2E test cases organized by feature area (chunk, css, file, hooks, html, incremental, lazy-compilation, make, module-federation, persistent-cache, react, vue3, worker)fixtures/: Shared fixtures and utilities for E2E testsutils/: Utility functions for E2E test executionbench/)Performance benchmarks for tracking Rspack JavaScript API performance and preventing performance degradation:
fixtures/: Benchmark test fixtures (e.g., ts-react project for benchmarking)