lib/tasks/vite.rake in vite_ruby-3.0.10 vs lib/tasks/vite.rake in vite_ruby-3.1.0
- old
+ new
@@ -48,9 +48,24 @@
Rake::Task["#{ prefix }vite:build"].invoke
end
else
Rake::Task.define_task('assets:precompile' => ['vite:install_dependencies', 'vite:build'])
end
+
+ unless Rake::Task.task_defined?('assets:clean')
+ Rake::Task.define_task('assets:clean', [:keep, :age])
+ end
+ Rake::Task['assets:clean'].enhance do |_, args|
+ Rake::Task['vite:clean'].invoke(*args.to_h.values)
+ end
+
+ if Rake::Task.task_defined?('assets:clobber')
+ Rake::Task['assets:clobber'].enhance do
+ Rake::Task['vite:clobber'].invoke
+ end
+ else
+ Rake::Task.define_task('assets:clobber' => 'vite:clobber')
+ end
end
# Any prerequisite task that installs packages should also install build dependencies.
if ARGV.include?('assets:precompile')
ENV['NPM_CONFIG_PRODUCTION'] = 'false'