# Installing yarn
brew install node
brew install yarn
gem install rails --pre
# For older versions,
rails _5.0.1_ new testapp
# To use webpack
rails new testapp --webpack
# or with a JS Framework
rails new testapp --webpack=vue|angular|react
# To install the JS Framework after creating the app
To have compile the webpack assets, which will install to public/packs/folders
brew install chromedriver
rails g system_test WelcomeController
class WelcomeControllersTest < ApplicationSystemTestCase
test "visiting the index" do
assert_selector "h1", text: "Welcome"
config.x.webpacker[:dev_server_host] = "http://localhost:8080"
Start webpack-dev-server to serve the assets with webpack. Keep in mind that you will also need the Rails server running as well.
Adding a JS Library to the application via yarn and webpack
yarn add jquery
//= require jquery/dist/jquery