Installing Stimulus
Explore how to install Stimulus within a Rails application configured with Webpacker. Learn to manage package setup, prepare for TypeScript integration by adjusting file settings, and understand the structure added by the Stimulus installer to support frontend development.
We'll cover the following...
Stimulus is one of the frameworks Webpacker is aware of, and, because of that, there’s a default path to installation within our Rails app.
The first thing we are going to do to install Stimulus is remove application/javascript/src and reset application/javascript/packs/application.ts back to its original application/javascript/packs/application.js form (the Stimulus installer expects it there). Then, we’re going to use Webpacker’s installer to add Stimulus:
$ bundle exec rails webpacker:install:stimulus
Here’s what the ...