Skip to content

Migrate from Webpacker #3185

Closed
Closed
@benjaminfaure

Description

@benjaminfaure

Hello everyone,

With the release of Rails 7, the webpacker gem has been abandonned and is no longer maintained by the developpers.
There's three solutions and all of them are compatible with Rails 6.1 so it could be setted up before migrating to Rails 7, thus the migration would be "less" painful.

For existing applications, Rails recommend the use of jsbundling-rails. There's a nice switching guide for users who wants to migrate from webpacker.
With JSBuilding we could use other bundlers such as esbuild that are a lot faster than webpack (see demo here), but it would require additional work.
Webpacker had a lot of builders bundled so the package.json file would grow a lot as it would need to include each required library used by webpacker.

Rails 7 uses importmap by default, but it's a big change as it no longer uses the whole Node/NPM ecosystem. It seems like a lot of work and Rails recommend it for new applications.

The last solution is to use the shakapacker gem which is a fork of the webpacker. The work would be "minimal" as it's basicaly webpacker, but it's not official so you never know for how long it would be maintained.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions