one of:
npm i opal-webpack-loader
yarn add opal-webpack-loader
gem install opal-webpack-loader
or add it to the Gemfile as below and bundle install
gem 'opal', github: 'janbiedermann/opal', branch: 'es6_modules' # requires this branch
gem 'opal-webpack-loader', '~> 0.13.0' # use the most recent released version here
See the configuration templates and adjust to your preference.