Unverified Commit 0f0ba8fc authored by Will Binns-Smith's avatar Will Binns-Smith Committed by GitHub

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.
parent 67325eaf
......@@ -3,7 +3,7 @@
> [!WARNING]
> 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.
This example demonstrates using Rspack in place of webpack in Next.js using `@next/plugin-rspack`.
This example demonstrates using Rspack in place of webpack in Next.js using `next-rspack`.
## Deploy your own
......
const withRspack = require("@next/plugin-rspack");
const withRspack = require("next-rspack");
/** @type {import('next').NextConfig} */
const nextConfig = {
......
......@@ -11,7 +11,7 @@
"react-dom": "^18.3.1"
},
"devDependencies": {
"@next/plugin-rspack": "canary",
"next-rspack": "canary",
"@types/node": "^22.10.1",
"@types/react": "^18.3.12",
"typescript": "^5.7.2"
......
# @next/plugin-rspack (EXPERIMENTAL)
# next-rspack (EXPERIMENTAL)
> [!WARNING]
> 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,13 +8,13 @@ This plugin allows you to use [Rspack](https://rspack.dev) in place of webpack w
## Installation
```
npm install @next/plugin-rspack
npm install next-rspack
```
or
```
yarn add @next/plugin-rspack
yarn add next-rspack
```
## Usage
......@@ -22,7 +22,7 @@ yarn add @next/plugin-rspack
Create or update a `next.config.js`/`next.config.ts` and wrap your existing configuration:
```js
const withRspack = require('@next/plugin-rspack')
const withRspack = require('next-rspack')
/** @type {import('next').NextConfig} */
const nextConfig = {
......@@ -34,11 +34,11 @@ module.exports = withRspack(nextConfig)
## Usage with next-compose-plugins
Alternatively, you can use `next-compose-plugins` to quickly integrate `@next/plugin-rspack` with other Next.js plugins:
Alternatively, you can use `next-compose-plugins` to quickly integrate `next-rspack` with other Next.js plugins:
```js
const withPlugins = require('next-compose-plugins')
const withRspack = require('@next/plugin-rspack')
const withRspack = require('next-rspack')
module.exports = withPlugins([
[withRspack],
......
{
"name": "@next/plugin-rspack",
"name": "next-rspack",
"version": "15.3.0-canary.33",
"repository": {
"url": "vercel/next.js",
......
......@@ -645,8 +645,8 @@
"644": "@rspack/core is not available. Please make sure the appropriate Next.js plugin is installed.",
"645": "@rspack/plugin-react-refresh is not available. Please make sure the appropriate Next.js plugin is installed.",
"646": "No span found for compilation",
"647": "@rspack/core is not available. Please make sure `@next/plugin-rspack` is correctly installed.",
"648": "@rspack/plugin-react-refresh is not available. Please make sure `@next/plugin-rspack` is correctly installed.",
"647": "@rspack/core is not available. Please make sure `next-rspack` is correctly installed.",
"648": "@rspack/plugin-react-refresh is not available. Please make sure `next-rspack` is correctly installed.",
"649": "Cache handlers not initialized",
"650": "experimental.nodeMiddleware",
"651": "Unexpected module type %s",
......
......@@ -141,7 +141,7 @@ async function printInfo() {
if (process.env.NEXT_RSPACK) {
relevantPackages += `
@next/plugin-rspack: ${getPackageVersion('@next/plugin-rspack')}`
next-rspack: ${getPackageVersion('next-rspack')}`
}
console.log(`
......
......@@ -8,7 +8,7 @@ export function getRspackCore() {
} catch (e) {
if (e instanceof Error && 'code' in e && e.code === 'MODULE_NOT_FOUND') {
throw new Error(
'@rspack/core is not available. Please make sure `@next/plugin-rspack` is correctly installed.'
'@rspack/core is not available. Please make sure `next-rspack` is correctly installed.'
)
}
......@@ -24,7 +24,7 @@ export function getRspackReactRefresh() {
} catch (e) {
if (e instanceof Error && 'code' in e && e.code === 'MODULE_NOT_FOUND') {
throw new Error(
'@rspack/plugin-react-refresh is not available. Please make sure `@next/plugin-rspack` is correctly installed.'
'@rspack/plugin-react-refresh is not available. Please make sure `next-rspack` is correctly installed.'
)
}
......
......@@ -1646,18 +1646,6 @@ importers:
specifier: ^0.7.0
version: 0.7.3
packages/next-plugin-rspack:
dependencies:
'@rspack/core':
specifier: 1.3.0
version: 1.3.0(@swc/helpers@0.5.15)
'@rspack/plugin-react-refresh':
specifier: 1.0.1
version: 1.0.1(react-refresh@0.12.0)
react-refresh:
specifier: 0.12.0
version: 0.12.0
packages/next-plugin-storybook: {}
packages/next-polyfill-module:
......@@ -1681,6 +1669,18 @@ importers:
specifier: 3.0.0
version: 3.0.0
packages/next-rspack:
dependencies:
'@rspack/core':
specifier: 1.3.0
version: 1.3.0(@swc/helpers@0.5.15)
'@rspack/plugin-react-refresh':
specifier: 1.0.1
version: 1.0.1(react-refresh@0.12.0)
react-refresh:
specifier: 0.12.0
version: 0.12.0
packages/next-swc:
devDependencies:
'@napi-rs/cli':
......@@ -134,9 +134,7 @@ async function createNextInstall({
}
if (useRspack) {
combinedDependencies['@next/plugin-rspack'] = pkgPaths.get(
'@next/plugin-rspack'
)
combinedDependencies['next-rspack'] = pkgPaths.get('next-rspack')
}
const scripts = {
......@@ -192,7 +190,7 @@ async function createNextInstall({
}
if (useRspack) {
// This is what the @next/plugin-rspack plugin does.
// This is what the next-rspack plugin does.
// TODO: Load the plugin properly during test
process.env.NEXT_RSPACK = 'true'
process.env.RSPACK_CONFIG_VALIDATE = 'loose-silent'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment