Introduction to Webpacker
Explore how Webpacker integrates with Rails to simplify asset management, including setup, configuration, and practical usage for JavaScript and CSS packs. Understand development and deployment workflows to streamline your Rails application.
We'll cover the following...
As Rails 6 developers, our primary interaction with webpack is going to be through the Webpacker tool provided by Rails. In this chapter, we’ll take a look at using Webpacker in development and how to customize it when we want additional features.
The Webpacker gem is a default part of a new Rails 6 installation, which means Webpacker goes in the Gemfile and, by default, the webpack:install task is run when the app is created. We can skip Webpacker entirely with rails new . --skip-webpack-install, or we can install one of the existing frameworks with something like rails new . ...