From 01f2056cde4487f812d3533625dbf419123372ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lovro=20Biki=C4=87?= Date: Tue, 3 Oct 2023 14:58:12 +0200 Subject: [PATCH] Revert "Support Rails 6 asset recompilation through webpacker" (#723) * Revert "Support Rails 6 asset recompilation through webpacker (#656)" This reverts commit 5f413c2e59af64de8cc754d1928bd0203aa32e79. * Update expected output --- spec/support/outputs/rails_assets_precompile.txt | 2 +- spec/support/outputs/rails_assets_precompile_with_diff.txt | 2 +- tasks/mina/rails.rb | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/support/outputs/rails_assets_precompile.txt b/spec/support/outputs/rails_assets_precompile.txt index 2c6bc21b..bebd3a8f 100644 --- a/spec/support/outputs/rails_assets_precompile.txt +++ b/spec/support/outputs/rails_assets_precompile.txt @@ -1 +1 @@ -if\ diff\ \-qrN\ ".*/deploy/current/vendor/assets/"\ "\./vendor/assets/"\ 2>/dev/null\ &&\ diff\ \-qrN\ ".*/deploy/current/app/assets/"\ "\./app/assets/"\ 2>/dev/null\ &&\ diff\ \-qrN\ ".*/deploy/current/app/javascript/"\ "\./app/javascript/"\ 2>/dev/null &&\ diff\ \-qrN\ ".*/deploy/current/package.json"\ "\./package.json"\ 2>/dev/null\s*then\s*echo\ "\-\-\-\-\->\ Skipping\ asset\ precompilation"\s*else\s*echo\ "\-\-\-\-\->\ Precompiling\ asset\ files"\s*RAILS_ENV="production"\ bundle\ exec\ rake\ assets:precompile\s*fi +if\ diff\ \-qrN\ ".*/deploy/current/vendor/assets/"\ "\./vendor/assets/"\ 2>/dev/null\ &&\ diff\ \-qrN\ ".*/deploy/current/app/assets/"\ "\./app/assets/"\ 2>/dev/null\s*then\s*echo\ "\-\-\-\-\->\ Skipping\ asset\ precompilation"\s*else\s*echo\ "\-\-\-\-\->\ Precompiling\ asset\ files"\s*RAILS_ENV="production"\ bundle\ exec\ rake\ assets:precompile\s*fi diff --git a/spec/support/outputs/rails_assets_precompile_with_diff.txt b/spec/support/outputs/rails_assets_precompile_with_diff.txt index 5bf27393..2c6bd512 100644 --- a/spec/support/outputs/rails_assets_precompile_with_diff.txt +++ b/spec/support/outputs/rails_assets_precompile_with_diff.txt @@ -1,4 +1,4 @@ -if diff -qrN ".*/deploy/current/vendor/assets/" "\./vendor/assets/" 2>/dev/null && diff -qrN ".*/deploy/current/app/assets/" "\./app/assets/" 2>/dev/null && diff -qrN ".*/deploy/current/app/javascript/" "\./app/javascript/" 2>/dev/null && diff -qrN ".*/deploy/current/package\.json" "\./package\.json" 2>/dev/null +if diff -qrN ".*/deploy/current/vendor/assets/" "\./vendor/assets/" 2>/dev/null && diff -qrN ".*/deploy/current/app/assets/" "\./app/assets/" 2>/dev/null then echo "-----> Skipping asset precompilation" else diff --git a/tasks/mina/rails.rb b/tasks/mina/rails.rb index 66543190..2622c7c6 100644 --- a/tasks/mina/rails.rb +++ b/tasks/mina/rails.rb @@ -7,11 +7,11 @@ set :bundle_prefix, -> { %(RAILS_ENV="#{fetch(:rails_env)}" #{fetch(:bundle_bin)} exec) } set :rake, -> { "#{fetch(:bundle_prefix)} rake" } set :rails, -> { "#{fetch(:bundle_prefix)} rails" } -set :compiled_asset_path, ['public/assets', 'public/packs'] -set :asset_dirs, ['vendor/assets/', 'app/assets/', 'app/javascript/', 'package.json'] +set :compiled_asset_path, 'public/assets' +set :asset_dirs, ['vendor/assets/', 'app/assets/'] set :migration_dirs, ['db/migrate'] -set :shared_dirs, fetch(:shared_dirs, []).push('log', 'tmp/cache', 'node_modules', *fetch(:compiled_asset_path)) +set :shared_dirs, fetch(:shared_dirs, []).push('log', 'tmp/cache', fetch(:compiled_asset_path)) desc 'Starts an interactive console.' task :console do