git commit -am "Before rspack" # rspack:migrate refuses to run on a dirty tree (RSPACK_FORCE=1 to override)
bin/rails rspack:migrate
git diff # review what changed
bin/devWhen it finishes, it lists any remaining lines that mention importmap or jsbundling, so you can check them by hand.
Shakapacker and Webpacker apps are not supported.
From importmap-rails #
- Every
pininconfig/importmap.rbbecomes an npm dependency. Versions recorded by importmap (# @1.2.3or jspm URLs) are kept. Gem-served pins such as Turbo install the latest npm release. javascript_importmap_tagsis replaced withrspack_javascript_tagin each layout or layout partial that called it, andimport "controllers"with the Stimulus autoloader.config/importmap.rb,bin/importmap, vendored packages, theimportmap-railsgem,stale_when_importmap_changesand thebin/importmap auditCI step are removed.- Bare imports of app code (
import "controllers/application") keep working throughresolve.modules.
From jsbundling-rails #
For esbuild, webpack and rollup setups.
- The
jsbundling-railsgem, the old bundler package and its config file are removed.Procfile.devruns the Rspack dev server. javascript_include_tag "application"becomesrspack_javascript_tag, and the generatedcontrollers/index.jsgives way to the autoloader.- Extra entry files in the root of
app/javascript/are listed so you can move them toapp/javascript/entrypoints/.
From tailwindcss-rails #
This is what rails new --css tailwind sets up. Run bin/rails rspack:migrate first, then:
bin/rails rspack:install:tailwindIt moves app/assets/tailwind/application.css (with your @theme, @plugin and @source lines), and the other CSS files next to it, to app/javascript/. It also removes the gem, the css: line in Procfile.dev and the old tailwind.css build.
From dartsass-rails #
This is what rails new --css sass sets up. Run bin/rails rspack:migrate first, then:
bin/rails rspack:install:sassIt imports app/assets/stylesheets/application.scss where it is, so its partials keep working, and removes the gem, the css: line in Procfile.dev and the old build. If you had custom builds in config/initializers/dartsass.rb, import each of those files from JavaScript.
A new app with rails new options #
template.rb works with any rails new options. The default importmap setup is migrated to Rspack, and --css tailwind or --css sass are moved over for you.