Skip to content

Commit

Permalink
Add constant to make clear usage
Browse files Browse the repository at this point in the history
  • Loading branch information
megatux committed Nov 27, 2023
1 parent 29f0e07 commit 1fa9e6b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/generators/htmx/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class InstallGenerator < ::Rails::Generators::Base
WEBPACKER_SETUP = "require('htmx.org')\n"
SPROCKETS_SETUP = "//= require htmx\n"
IMPORTMAP_SETUP = "import \"htmx.org\"\n"
BUN_SETUP = IMPORTMAP_SETUP

desc 'Prep application.js to include HTMX installation for Webpacker, Sprockets or Importmap'

Expand Down Expand Up @@ -57,7 +58,7 @@ def add_to_manifest(manifest, text)
def setup_bun
run "bun add htmx.org@#{Htmx::Rails::HTMX_VERSION}"

add_to_manifest(manifest('app/javascript'), IMPORTMAP_SETUP)
add_to_manifest(manifest('app/javascript'), BUN_SETUP)
end

def setup_importmap
Expand Down

0 comments on commit 1fa9e6b

Please sign in to comment.