Managing JS and CSS Assets in Rails 7

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • import-maps

    How to control the behavior of JavaScript imports

  • Import Maps is the pattern being shipped with a default Rails 7 application. It makes use of a feature where JavaScript modules that would typically be installed with a package manager, such as Yarn or npm, and in most cases transpiled and bundled into a .js file can be imported directly into the browser and used in your application without an extra build step.

  • importmap-rails

    Use ESM with importmap to manage modern JavaScript in Rails without transpiling or bundling.

  • // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails import "@hotwired/turbo-rails" import "controllers" import "trix" import "@rails/actiontext" // Importing the home.js script here! import "./home" import LocalTime from "local-time" LocalTime.start()

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • cssbundling-rails

    Bundle and process CSS in Rails with Tailwind, PostCSS, and Sass via Node.js.

  • The Rails team has made available the jsbundling-rails gem that streamlines configuring your application with esbuild, Webpack or Rollup along with [cssbundling-rails](https://github.com/rails/cssbundling-rails) which is the equivalent to manage CSS bundling. Yarn is used in this case.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts