November 02, 2023
Rspack no longer supports Node.js 14, Node.js 16+ is now required.
@rspack/core
is now a peer dependency of @rspack/cli
rather than a direct dependency. This means that you need to manually install @rspack/core
with @rspack/cli
now. aligning Rspack more closely with webpack. In the long term, the positioning of @rspack/cli
will no longer be an out-of-the-box solution. We will align @rspack/cli
with webpack-cli and may even directly support the use of @rspack/core
in webpack-cli
. We recommend Rsbuild as an out-of-the-box solution.
experiments.rspackFuture.disableTransformByDefault
is enabled by default in v0.4.0. For people that still need the legacy behavior, you may manually set this option to false
.
This feature primarily addresses three categories of problems: builtins code transformation features, target, and custom Rule.type.
rspackExperiments.relay
jsc.transform.react
rspackExperiments.emotion
rspackExperiments.import
jsc.parser.decorators
jsc.env
node_modules
)These types have been removed:
"typescript"
"jsx"
"tsx"
For JS-related types, only the following will be retained:
"javascript/auto"
"javascript/esm"
"javascript/dynamic"
Refer to this for the complete migration guide.
Check out our previous discussion here.
With experiments.rspackFuture.disableTransformByDefault
is enabled by default in v0.4.0, builtin.react.refresh
has also been deprecated. Now we recommend using @rspack/plugin-react-refresh
to enable react fast refresh.
Checkout here for more details.
builtin:sass-loader
has now been deprecated. If you are using it, migrate to sass-loader
. Rspack will remove builtin:sass-loader
in v0.5.0.
experiments.incrementalRebuild
has now been deprecated. Rspack will remove it in v0.5.0.
Before, some APIs should not be exported accidentally exported through re-export from @rspack/core. Now with this refactor, we clean up the export APIs from @rspack/core.
This shouldn't break anything, but if you are using unintentionally exported APIs, this may break you, and you may be using Rspack in the hacky way.
If there is a real need for removed APIs from this refactor, please raise an issue in the Rspack repository.
builtins.devFriendlySplitChunks
and experiments.newSplitChunks
In order to full migrate to Webpack's split chunks implementation, these fields are deprecated. Rspack will remove these fields in v0.5.0.
New resolver is now enabled by default.
The new resolver has passed all of enhanced-resolve's test suite. It is 5 times faster than previous implementation, and 28 times faster than enhanced-resolve.
The new resolver can be configured to read tsconfig.json
's compilerOptions.paths
and references
field and provides better support for nested path alias. See API resolve.tsConfig for details.
To opt out of the new resolver, set experiments.rspackFuture.newResolver
to false
.
There is a migrate example demonstrating how to migrate from Rspack 0.3.14 to Rspack 0.4.0.
@rspack/cli
or Rsbuild
?If your application is a CSR application, we strongly encourage you to use Rsbuild instead of configuring Rspack yourself, as Rsbuild is much easier to use compared to @rspack/cli
.
Rspack no longer supports Node.js 14 as of version 0.4.0; Node.js 16+ is now required.
@rspack/core
Manually with @rspack/cli
builtin:swc-loader
to Support Module TransformationRspack no longer transforms files by default as of version 0.4.0, you can still enable old transform behavior by the following setting
But we suggest you use builtin:swc-loader
to transform files now. More details are available in Deprecating Default Transformation.
@rspack/plugin-react-refresh
for React Applicationsbuiltin.react.refresh
does not work when we disable the default transformation, so you need to use @rspack/plugin-react-refresh
to enable fast refresh. More details are available in Deprecating builtin.react.refresh.
In v0.4.0, Rspack deprecated some of the builtin options and migrated them to builtin plugins.
Currently, Rspack's internal plugins are divided into two categories:
The original builtins.define
can be migrated as follows:
For builtins.html
, it can be directly migrated to HtmlRspackPlugin:
When there are multiple configurations in builtins.html
, multiple plugin instances can be created:
For builtins.copy
, it can be directly migrated to CopyRspackPlugin.
For the original builtins.minifyOptions
, we provide SwcJsMinimizerRspackPlugin:
Other builtin options can be directly referred to the rspack builtin plugins for migration, or completed according to the CLI prompts after upgrading to v0.4.0.