kind of works with importmaps

This commit is contained in:
Philipp Rothmann 2023-02-09 11:48:17 +01:00
parent 69518f2bae
commit 2e7e8828bf
5 changed files with 8 additions and 15 deletions

View file

@ -1,5 +0,0 @@
//= link_tree ../images
//= link_directory ../stylesheets .css
//= link_tree ../../javascript .js
//= link_tree ../javascripts .js
//= link_tree ../../../vendor/javascript .js

View file

@ -20,12 +20,11 @@
\==================================================
/ Placed at the end of the document so the pages load faster
= javascript_importmap_tags
= javascript_include_tag "application_legacy"
-# = javascript_include_tag "application"
-# :javascript
-# I18n.defaultLocale = "#{I18n.default_locale}";
-# I18n.locale = "#{I18n.locale}";
-# I18n.fallbacks = true;
-# = yield(:javascript)
:javascript
I18n.defaultLocale = "#{I18n.default_locale}";
I18n.locale = "#{I18n.locale}";
I18n.fallbacks = true;
= yield(:javascript)
= raw FoodsoftConfig[:webstats_tracking_code]

View file

@ -1,3 +1,2 @@
# Pin npm packages by running ./bin/importmap
pin "application", preload: true

View file

@ -9,4 +9,4 @@ Rails.application.config.assets.version = '1.0'
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in the app/assets
# folder are already added.
Rails.application.config.assets.precompile += %w( jquery.min.js )
Rails.application.config.assets.precompile += %w( application_legacy.js jquery.min.js )