feat: upgrade to @rspress/core v2#1
Merged
jkzing merged 6 commits intoweb-infra-dev:mainfrom Mar 19, 2026
Merged
Conversation
- Update rspress dependency to @rspress/core ^2.0.3 - Add React 19 dependencies for v2 - Add "type": "module" for ESM support - Update import from 'rspress/config' to '@rspress/core' - Upgrade tsconfig.json to v2 standards
There was a problem hiding this comment.
Pull request overview
This PR updates the project to a more modern ESM + TypeScript configuration and begins migrating the Rspress integration to the @rspress/core package.
Changes:
- Expand
tsconfig.jsonwith stricter type-checking and bundler/ESM-oriented module settings. - Update
rspress.config.tsimports to use Node’snode:prefix and@rspress/core. - Switch the package to ESM (
"type": "module") and update dependencies toward the newer Rspress/React/Node types stack.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tsconfig.json | Adds modern TS compiler options, strictness, and MDX checking config. |
| rspress.config.ts | Updates imports to Node built-ins and the new Rspress config entrypoint. |
| package.json | Marks the package as ESM and changes dependency set toward @rspress/core + React typings/runtime. |
Comments suppressed due to low confidence (1)
rspress.config.ts:6
- With
"type": "module"inpackage.json, this config will be evaluated as ESM in Node;__dirnameis not defined in ESM modules. This will throw at runtime when Rspress loads the config. Replace__dirnameusage with an ESM-safe directory derivation (viaimport.meta.url+fileURLToPath) or another approach supported by Rspress.
import * as path from 'node:path';
import { defineConfig } from '@rspress/core';
export default defineConfig({
root: path.join(__dirname, 'docs'),
title: 'Rspress',
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jkzing
approved these changes
Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrade the CodeSandbox template from rspress v1 to v2.
Changes
rspress: ^1.0.0to@rspress/core: ^2.0.3react,react-dom)"type": "module"for ESM support'rspress/config'to'@rspress/core'Related
Discussion #3195
refactor(create-rspress): update template to match latest Rspress features and structure rspress#3226