From 1e63c59a8af120da718bd8919795408a682b3f5b Mon Sep 17 00:00:00 2001 From: Philipp Rothmann Date: Wed, 23 Aug 2023 12:17:32 +0200 Subject: [PATCH] fix: loading trix editor overwrite in production --- app/javascript/application.js | 2 +- config/importmap.rb | 1 + config/initializers/assets.rb | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/javascript/application.js b/app/javascript/application.js index 1ba4a01a..141d3cae 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -1,4 +1,4 @@ // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails import "trix" import "@rails/actiontext" -import "./trix-editor-overrides" +import "trix-editor-overrides" diff --git a/config/importmap.rb b/config/importmap.rb index f882664b..d6d39932 100644 --- a/config/importmap.rb +++ b/config/importmap.rb @@ -2,3 +2,4 @@ pin "application", preload: true pin "trix" pin "@rails/actiontext", to: "actiontext.js" +pin "trix-editor-overrides" \ No newline at end of file diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index d507a355..d52cecaa 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -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[application_legacy.js jquery.min.js] +Rails.application.config.assets.precompile += %w[application_legacy.js jquery.min.js trix-editor-overrides.js]