Skip to content

Commit

Permalink
fix: ensure assets:precompile task is displayed when using rake -T
Browse files Browse the repository at this point in the history
  • Loading branch information
ElMassimo committed May 9, 2023
1 parent 12d9cf3 commit 66af6eb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vite_ruby/lib/tasks/vite.rake
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ unless ENV['VITE_RUBY_SKIP_ASSETS_PRECOMPILE_EXTENSION'] == 'true'
Rake::Task["#{ prefix }vite:build_all"].invoke
end
else
desc 'Bundle Vite assets'
Rake::Task.define_task('assets:precompile' => ['vite:install_dependencies', 'vite:build_all'])
end

unless Rake::Task.task_defined?('assets:clean')
desc 'Remove old compiled assets'
Rake::Task.define_task('assets:clean', [:keep, :age])
end
Rake::Task['assets:clean'].enhance do |_, args|
Expand All @@ -78,6 +80,7 @@ unless ENV['VITE_RUBY_SKIP_ASSETS_PRECOMPILE_EXTENSION'] == 'true'
Rake::Task['vite:clobber'].invoke
end
else
desc 'Remove compiled assets'
Rake::Task.define_task('assets:clobber' => 'vite:clobber')
end
end
Expand Down

0 comments on commit 66af6eb

Please sign in to comment.