Sha256: 4a6e79c8d7a04540962534c717d4ea38ec2063a9781dbbc0f147885d61c8c0c6

Contents?: true

Size: 663 Bytes

Versions: 2

Compression:

Stored size: 663 Bytes

Contents

say "Create controllers directory"
empty_directory "app/javascript/controllers"

if Rails.root.join("config/webpacker.yml").exist?
  copy_file "#{__dir__}/app/javascript/controllers/index_for_webpacker.js",
    "app/javascript/controllers/index.js"
else
  copy_file "#{__dir__}/app/javascript/controllers/index_for_node.js",
    "app/javascript/controllers/index.js"
end

copy_file "#{__dir__}/app/javascript/controllers/hello_controller.js",
  "app/javascript/controllers/hello_controller.js"

say "Import Stimulus controllers"
append_to_file "app/javascript/application.js", %(import "./controllers"\n)

say "Install Stimulus"
run "yarn add @hotwired/stimulus"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stimulus-rails-0.4.1 lib/install/stimulus_with_node.rb
stimulus-rails-0.4.0 lib/install/stimulus_with_node.rb