Skip to content

Commit

Permalink
Migrate to importmap
Browse files Browse the repository at this point in the history
  • Loading branch information
jsuchal committed Nov 26, 2024
1 parent f7f28d1 commit f1979cb
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//= link_tree ../images
//= link_directory ../stylesheets .css
//= link_tree ../builds
//= link tailwind.css
//= link_tree ../../javascript .js
//= link_tree ../../../vendor/javascript .js
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link rel="manifest" crossorigin="use-credentials" href="/manifest.json" />
<%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>
<%= javascript_importmap_tags %>
<%= favicon_link_tag 'SD_icon_square_white.png', type: "image/png" %>
</head>
<body class="h-full">
Expand Down
4 changes: 4 additions & 0 deletions bin/importmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env ruby

require_relative "../config/application"
require "importmap/commands"
7 changes: 3 additions & 4 deletions config/importmap.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true
pin_all_from "app/javascript/controllers", under: "controllers"
pin_all_from "app/javascript/custom", under: "custom"
# Pin npm packages by running ./bin/importmap

pin "application"
File renamed without changes.

0 comments on commit f1979cb

Please sign in to comment.