next-rspack 15.3.0-canary.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # next-rspack (EXPERIMENTAL)
2
+
3
+ > [!WARNING]
4
+ > 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.
5
+
6
+ This plugin allows you to use [Rspack](https://rspack.dev) in place of webpack with Next.js.
7
+
8
+ ## Installation
9
+
10
+ ```
11
+ npm install next-rspack
12
+ ```
13
+
14
+ or
15
+
16
+ ```
17
+ yarn add next-rspack
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ Create or update a `next.config.js`/`next.config.ts` and wrap your existing configuration:
23
+
24
+ ```js
25
+ const withRspack = require('next-rspack')
26
+
27
+ /** @type {import('next').NextConfig} */
28
+ const nextConfig = {
29
+ /* config options here */
30
+ }
31
+
32
+ module.exports = withRspack(nextConfig)
33
+ ```
34
+
35
+ ## Usage with next-compose-plugins
36
+
37
+ Alternatively, you can use `next-compose-plugins` to quickly integrate `next-rspack` with other Next.js plugins:
38
+
39
+ ```js
40
+ const withPlugins = require('next-compose-plugins')
41
+ const withRspack = require('next-rspack')
42
+
43
+ module.exports = withPlugins([
44
+ [withRspack],
45
+ // your other plugins here
46
+ ])
47
+ ```
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import type { NextConfig } from 'next'
2
+
3
+ declare function NextPluginRspack(config: NextConfig): NextConfig
4
+
5
+ export = NextPluginRspack
package/index.js ADDED
@@ -0,0 +1,5 @@
1
+ module.exports = function withRspack(config) {
2
+ process.env.NEXT_RSPACK = 'true'
3
+ process.env.RSPACK_CONFIG_VALIDATE = 'loose-silent'
4
+ return config
5
+ }
package/package.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "next-rspack",
3
+ "version": "15.3.0-canary.34",
4
+ "repository": {
5
+ "url": "vercel/next.js",
6
+ "directory": "packages/next-plugin-rspack"
7
+ },
8
+ "types": "index.d.ts",
9
+ "dependencies": {
10
+ "@rspack/core": "1.3.0",
11
+ "@rspack/plugin-react-refresh": "1.0.1",
12
+ "react-refresh": "0.12.0"
13
+ }
14
+ }