Regarding 2 imports when running `rails hotwire:install`
Hi,
When running rails hotwire:install
, it shows 2 warnings:
You must import "./controllers" in your JavaScript entrypoint
You must import @hotwired/turbo-rails in your JavaScript entrypoint file
Where is that JavaScript entrypoint file application.js
?
Under javascript/controllers
or javascript/packs
?
Thanks.
Full output
Create controllers directory
create app/javascript/controllers
create app/javascript/controllers/index.js
create app/javascript/controllers/application.js
create app/javascript/controllers/hello_controller.js
You must import "./controllers" in your JavaScript entrypoint
Install Stimulus
run yarn add @hotwired/stimulus from "."
yarn add v1.22.17
[1/4] π Resolving packages...
[2/4] π Fetching packages...
[3/4] π Linking dependencies...
[4/4] π¨ Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
ββ @hotwired/stimulus@3.0.1
info All dependencies
ββ @hotwired/stimulus@3.0.1
β¨ Done in 5.11s.
You must import @hotwired/turbo-rails in your JavaScript entrypoint file
Install Turbo
run yarn add @hotwired/turbo-rails from "."
yarn add v1.22.17
[1/4] π Resolving packages...
[2/4] π Fetching packages...
[3/4] π Linking dependencies...
[4/4] π¨ Building fresh packages...
success Saved lockfile.
success Saved 2 new dependencies.
info Direct dependencies
ββ @hotwired/turbo-rails@7.1.0
info All dependencies
ββ @hotwired/turbo-rails@7.1.0
ββ @hotwired/turbo@7.1.0
β¨ Done in 4.87s.
Run turbo:install:redis to switch on Redis and use it in development for turbo streams