Skip to content

Commit

Permalink
docs: Add more help text in the example entrypoints
Browse files Browse the repository at this point in the history
Thanks for the suggestion @maxjacobson!
  • Loading branch information
ElMassimo committed Mar 18, 2021
1 parent 6b76032 commit 87d6f14
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 29 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ selenium-server.log
.env.*.local

docs/pnpm-lock.yaml
test/mounted_app/test/dummy/bin/vite
2 changes: 2 additions & 0 deletions examples/rails/app/frontend/entrypoints/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ import.meta.globEager('../channels/**/*_channel.js')

Turbolinks.start()
ActiveStorage.start()

console.log('Visit the guide for more information: ', 'https://vite-ruby.netlify.app/guide/rails')
29 changes: 0 additions & 29 deletions test/mounted_app/test/dummy/bin/vite

This file was deleted.

9 changes: 9 additions & 0 deletions vite_rails/lib/vite_rails/installation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ def install_sample_files
inject_line_before layout_file, '</head>', <<-HTML
<%= vite_client_tag %>
<%= vite_javascript_tag 'application' %>
<!--
If using a TypeScript entrypoint file:
vite_typescript_tag 'application'
If using a .jsx or .tsx entrypoint, add the extension:
vite_javascript_tag 'application.jsx'
Visit the guide for more information: https://vite-ruby.netlify.app/guide/rails
-->
HTML
end
end
Expand Down
8 changes: 8 additions & 0 deletions vite_rails/templates/entrypoints/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
// <%= vite_javascript_tag 'application' %>
console.log('Vite ⚡️ Rails')

// If using a TypeScript entrypoint file:
// <%= vite_typecript_tag 'application.jsx' %>
//
// If you want to use .jsx or .tsx, add the extension:
// <%= vite_javascript_tag 'application.jsx' %>

console.log('Visit the guide for more information: ', 'https://vite-ruby.netlify.app/guide/rails')

// Example: Load Rails libraries in Vite.
//
// import '@rails/ujs'
Expand Down
9 changes: 9 additions & 0 deletions vite_rails_legacy/lib/vite_rails_legacy/installation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ def install_sample_files
inject_line_before layout_file, '</head>', <<-HTML
<%= vite_client_tag %>
<%= vite_javascript_tag 'application' %>
<!--
If using a TypeScript entrypoint file:
vite_typescript_tag 'application'
If using a .jsx or .tsx entrypoint, add the extension:
vite_javascript_tag 'application.jsx'
Visit the guide for more information: https://vite-ruby.netlify.app/guide/rails
-->
HTML
end
end
Expand Down
8 changes: 8 additions & 0 deletions vite_rails_legacy/templates/entrypoints/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
// <%= vite_javascript_tag 'application' %>
console.log('Vite ⚡️ Rails')

// If using a TypeScript entrypoint file:
// <%= vite_typecript_tag 'application.jsx' %>
//
// If you want to use .jsx or .tsx, add the extension:
// <%= vite_javascript_tag 'application.jsx' %>

console.log('Visit the guide for more information: ', 'https://vite-ruby.netlify.app/guide/rails')

// Example: Load Rails libraries in Vite.
//
// import '@rails/ujs'
Expand Down

0 comments on commit 87d6f14

Please sign in to comment.