esbuild for Rails | Drifting Ruby


# Terminal
bundle add esbuild-rails
bin/rails esbuild:install
yarn build --watch
yarn add bootstrap
# app/javascript/application.js
// Entrypoint for the esbuild command defined in package.json scripts
import bootstrap from "bootstrap/dist/js/bootstrap.bundle"

new bootstrap.Popover(document.querySelector('[data-bs-toggle="popover"]'), {
  trigger: 'hover'
})
# app/assets/stylesheets/application.css
/*
 *= require "bootstrap"
 *= require_tree .
 *= require_self
 */
# config/initializers/assets.rb
Rails.application.config.assets.paths << 'node_modules'



Source link

Latest articles

Related articles

Leave a reply

Please enter your comment!
Please enter your name here