Sha256: c376ab07e5aa7dd6f938caa02f2e273f1dd758020c22fa74449f0b63196e7b00

Contents?: true

Size: 1.36 KB

Versions: 9

Compression:

Stored size: 1.36 KB

Contents

# frozen_string_literal: true

$stdout.sync = true

require 'rake'

namespace :vite do
  task :binstubs do
    ViteRuby.commands.install_binstubs
  end

  desc 'Compile JavaScript packs using vite for production with digests'
  task build: :'vite:verify_install' do
    ViteRuby.commands.build_from_task
  end

  desc 'Remove old compiled vites'
  task :clean, [:keep, :age] => :'vite:verify_install' do |_, args|
    ViteRuby.commands.clean_from_task(args)
  end

  desc 'Remove the vite build output directory'
  task clobber: :'vite:verify_install' do
    ViteRuby.commands.clobber
    $stdout.puts "Removed vite build output directory #{ ViteRuby.config.build_output_dir }"
  end

  desc 'Verifies if ViteRuby is properly installed in this application'
  task :verify_install do
    ViteRuby.commands.verify_install
  end

  desc 'Install all JavaScript dependencies'
  task :install_dependencies do
    system({ 'NODE_ENV' => 'development' }, 'npx ci')
  end

  desc "Provide information on ViteRuby's environment"
  task :info do
    ViteRuby.commands.print_info
  end
end

if Rake::Task.task_defined?('assets:precompile')
  Rake::Task['assets:precompile'].enhance do |task|
    prefix = task.name.split(/#|assets:precompile/).first
    Rake::Task["#{ prefix }vite:build"].invoke
  end
else
  Rake::Task.define_task('assets:precompile' => ['vite:install_dependencies', 'vite:build'])
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
vite_ruby-1.1.2 lib/tasks/vite.rake
vite_ruby-1.1.1 lib/tasks/vite.rake
vite_ruby-1.1.0 lib/tasks/vite.rake
vite_ruby-1.0.5 lib/tasks/vite.rake
vite_ruby-1.0.4 lib/tasks/vite.rake
vite_ruby-1.0.3 lib/tasks/vite.rake
vite_ruby-1.0.2 lib/tasks/vite.rake
vite_ruby-1.0.1 lib/tasks/vite.rake
vite_ruby-1.0.0 lib/tasks/vite.rake