Sha256: 5e9bf176dd87cc6cc0e77c81ee4c5af1ca7fa7e66b8def12ff9496fb63e0b48f

Contents?: true

Size: 734 Bytes

Versions: 1

Compression:

Stored size: 734 Bytes

Contents

if (app_js_path = Rails.root.join("app/javascript/application.js")).exist?
  say "Import turbo-rails in existing app/javascript/application.js"
  append_to_file app_js_path, %(import "@hotwired/turbo-rails"\n)
else
  say <<~INSTRUCTIONS, :red
    You must import @hotwired/turbo-rails in your application.js.
  INSTRUCTIONS
end

if (importmap_path = Rails.root.join("config/importmap.rb")).exist?
  say "Pin @hotwired/turbo-rails in config/importmap.rb"
  append_to_file importmap_path.to_s, %(pin "@hotwired/turbo-rails", to: "turbo.js"\n)
else
  say <<~INSTRUCTIONS, :red
    You must add @hotwired/turbo-rails to your importmap to reference them via ESM.
    Example: pin "@hotwired/turbo-rails", to: "turbo.js"
  INSTRUCTIONS
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
turbo-rails-0.7.10 lib/install/turbo_with_asset_pipeline.rb