Skip to content

Commit 0f0ba8f

Browse files
authoredApr 3, 2025··
Rename alternate bundler package name (#77793)
Test Plan: CI. Tested locally with `test/development/app-dir/basic/basic.test.ts`. Will test with a create-next-app once published.
1 parent 67325ea commit 0f0ba8f

File tree

12 files changed

+29
-31
lines changed

12 files changed

+29
-31
lines changed
 

‎examples/with-rspack/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> [!WARNING]
44
> This example uses a package is currently experimental and actively developed and supported in Next.js’ `canary` branch. To use this, you must be using a published canary build of Next.js.
55
6-
This example demonstrates using Rspack in place of webpack in Next.js using `@next/plugin-rspack`.
6+
This example demonstrates using Rspack in place of webpack in Next.js using `next-rspack`.
77

88
## Deploy your own
99

‎examples/with-rspack/next.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const withRspack = require("@next/plugin-rspack");
1+
const withRspack = require("next-rspack");
22

33
/** @type {import('next').NextConfig} */
44
const nextConfig = {

‎examples/with-rspack/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"react-dom": "^18.3.1"
1212
},
1313
"devDependencies": {
14-
"@next/plugin-rspack": "canary",
14+
"next-rspack": "canary",
1515
"@types/node": "^22.10.1",
1616
"@types/react": "^18.3.12",
1717
"typescript": "^5.7.2"

‎packages/next-plugin-rspack/README.md ‎packages/next-rspack/README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# @next/plugin-rspack (EXPERIMENTAL)
1+
# next-rspack (EXPERIMENTAL)
22

33
> [!WARNING]
44
> This package is currently experimental and actively developed and supported in Next.js’ `canary` branch. To use this, you must be using a published canary build of Next.js.
@@ -8,21 +8,21 @@ This plugin allows you to use [Rspack](https://rspack.dev) in place of webpack w
88
## Installation
99

1010
```
11-
npm install @next/plugin-rspack
11+
npm install next-rspack
1212
```
1313

1414
or
1515

1616
```
17-
yarn add @next/plugin-rspack
17+
yarn add next-rspack
1818
```
1919

2020
## Usage
2121

2222
Create or update a `next.config.js`/`next.config.ts` and wrap your existing configuration:
2323

2424
```js
25-
const withRspack = require('@next/plugin-rspack')
25+
const withRspack = require('next-rspack')
2626

2727
/** @type {import('next').NextConfig} */
2828
const nextConfig = {
@@ -34,11 +34,11 @@ module.exports = withRspack(nextConfig)
3434

3535
## Usage with next-compose-plugins
3636

37-
Alternatively, you can use `next-compose-plugins` to quickly integrate `@next/plugin-rspack` with other Next.js plugins:
37+
Alternatively, you can use `next-compose-plugins` to quickly integrate `next-rspack` with other Next.js plugins:
3838

3939
```js
4040
const withPlugins = require('next-compose-plugins')
41-
const withRspack = require('@next/plugin-rspack')
41+
const withRspack = require('next-rspack')
4242

4343
module.exports = withPlugins([
4444
[withRspack],
File renamed without changes.
File renamed without changes.

‎packages/next-plugin-rspack/package.json ‎packages/next-rspack/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@next/plugin-rspack",
2+
"name": "next-rspack",
33
"version": "15.3.0-canary.33",
44
"repository": {
55
"url": "vercel/next.js",

‎packages/next/errors.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -645,8 +645,8 @@
645645
"644": "@rspack/core is not available. Please make sure the appropriate Next.js plugin is installed.",
646646
"645": "@rspack/plugin-react-refresh is not available. Please make sure the appropriate Next.js plugin is installed.",
647647
"646": "No span found for compilation",
648-
"647": "@rspack/core is not available. Please make sure `@next/plugin-rspack` is correctly installed.",
649-
"648": "@rspack/plugin-react-refresh is not available. Please make sure `@next/plugin-rspack` is correctly installed.",
648+
"647": "@rspack/core is not available. Please make sure `next-rspack` is correctly installed.",
649+
"648": "@rspack/plugin-react-refresh is not available. Please make sure `next-rspack` is correctly installed.",
650650
"649": "Cache handlers not initialized",
651651
"650": "experimental.nodeMiddleware",
652652
"651": "Unexpected module type %s",

‎packages/next/src/cli/next-info.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ async function printInfo() {
141141

142142
if (process.env.NEXT_RSPACK) {
143143
relevantPackages += `
144-
@next/plugin-rspack: ${getPackageVersion('@next/plugin-rspack')}`
144+
next-rspack: ${getPackageVersion('next-rspack')}`
145145
}
146146

147147
console.log(`

‎packages/next/src/shared/lib/get-rspack.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function getRspackCore() {
88
} catch (e) {
99
if (e instanceof Error && 'code' in e && e.code === 'MODULE_NOT_FOUND') {
1010
throw new Error(
11-
'@rspack/core is not available. Please make sure `@next/plugin-rspack` is correctly installed.'
11+
'@rspack/core is not available. Please make sure `next-rspack` is correctly installed.'
1212
)
1313
}
1414

@@ -24,7 +24,7 @@ export function getRspackReactRefresh() {
2424
} catch (e) {
2525
if (e instanceof Error && 'code' in e && e.code === 'MODULE_NOT_FOUND') {
2626
throw new Error(
27-
'@rspack/plugin-react-refresh is not available. Please make sure `@next/plugin-rspack` is correctly installed.'
27+
'@rspack/plugin-react-refresh is not available. Please make sure `next-rspack` is correctly installed.'
2828
)
2929
}
3030

‎pnpm-lock.yaml

+12-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎test/lib/create-next-install.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,7 @@ async function createNextInstall({
134134
}
135135

136136
if (useRspack) {
137-
combinedDependencies['@next/plugin-rspack'] = pkgPaths.get(
138-
'@next/plugin-rspack'
139-
)
137+
combinedDependencies['next-rspack'] = pkgPaths.get('next-rspack')
140138
}
141139

142140
const scripts = {
@@ -192,7 +190,7 @@ async function createNextInstall({
192190
}
193191

194192
if (useRspack) {
195-
// This is what the @next/plugin-rspack plugin does.
193+
// This is what the next-rspack plugin does.
196194
// TODO: Load the plugin properly during test
197195
process.env.NEXT_RSPACK = 'true'
198196
process.env.RSPACK_CONFIG_VALIDATE = 'loose-silent'

0 commit comments

Comments
 (0)
Please sign in to comment.