移行

webpack から Rspack への移行

ライセンスと利用条件

webpack
MIT, オープンソース
Rspack
MIT, オープンソース
置き換えの度合い
ドロップイン Accepts webpack configuration and most of its loaders and plugins.

このページは英語で書かれています。

Compatibility

Rspack’s API and configuration align with webpack 5, and it supports most webpack configuration options, most built-in plugins (same names and parameters) and most loaders. The guide is written for webpack 5 projects: on webpack 4 or earlier, read webpack’s own v4 to v5 guide for the differences, and Create React App or Vue CLI projects have their own guides.

Before you switch

  1. Check Node.js on every build machine, CI included. @rspack/core@2 requires Node.js ^20.19.0 || >=22.12.0.
  2. Install @rspack/core, plus @rspack/cli and @rspack/dev-server if you used webpack-cli and webpack-dev-server. Keep @rspack/core and @rspack/cli on the same version.
  3. Point your scripts at rspack dev, rspack build and rspack preview, and rename webpack.config.js to rspack.config.js, the file Rspack loads when none is given.
  4. Take built-in plugins from @rspack/core instead of webpack (new webpack.DefinePlugin becomes new rspack.DefinePlugin), and replace ecosystem packages: webpack-dev-middleware becomes @rspack/dev-middleware, webpack-chain becomes rspack-chain, webpack-merge becomes rspack-merge.
  5. Once the build works, remove webpack, webpack-cli and webpack-dev-server, unless a loader, plugin or script still imports webpack or webpack/lib/*.

Pitfalls

公式ガイド

Rspackの移行ガイド ↗

2026-09-29にレビュー済み。

出典

webpackのその他の代替 →