According to https://github.com/rails/webpacker you should:
Add the webpacker gem to your Gemfile:
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker'
Then run (assuming you’re on macOS and using Homebrew):