From 6dd01b8c862b86f6e0fe7dee1b723740a1bb8bdd Mon Sep 17 00:00:00 2001 From: Niklas Haeusele Date: Sun, 22 Dec 2024 16:12:35 +0100 Subject: [PATCH] Add basic sprockets support Add hotwire_spark.js to the precompiled assets. This adds Sprockets support for Rails 8 applications. Fixes #36. --- lib/hotwire/spark/engine.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/hotwire/spark/engine.rb b/lib/hotwire/spark/engine.rb index 16548ca..d1ea7eb 100644 --- a/lib/hotwire/spark/engine.rb +++ b/lib/hotwire/spark/engine.rb @@ -18,6 +18,10 @@ class Engine < ::Rails::Engine end end + initializer "hotwire_spark.assets" do |application| + application.config.assets.precompile << "hotwire_spark.js" + end + initializer "hotwire_spark.install" do |application| Hotwire::Spark.install_into application if Hotwire::Spark.enabled? end