Sha256: d0b83bcfcbb6ed811faf7d505697c400f255ab3f5350752819dd6b5a88feb01a

Contents?: true

Size: 1.51 KB

Versions: 27

Compression:

Stored size: 1.51 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
  end

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

  desc 'Ensures build dependencies like Vite are installed when compiling assets'
  task :install_dependencies do
    system({ 'NODE_ENV' => 'development' }, 'npx --yes 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

# Any prerequisite task that installs packages should also install build dependencies.
if ARGV.include?('assets:precompile')
  ENV['NPM_CONFIG_PRODUCTION'] = 'false'
  ENV['YARN_PRODUCTION'] = 'false'
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
vite_ruby-3.0.0.beta.2 lib/tasks/vite.rake
vite_ruby-3.0.0.beta.1 lib/tasks/vite.rake
vite_ruby-2.0.0.beta.6 lib/tasks/vite.rake
vite_ruby-2.0.0.beta.5 lib/tasks/vite.rake
vite_ruby-2.0.0.beta.4 lib/tasks/vite.rake
vite_ruby-2.0.0.beta.3 lib/tasks/vite.rake
vite_ruby-2.0.0.beta.2 lib/tasks/vite.rake
vite_ruby-2.0.0.beta.1 lib/tasks/vite.rake
vite_ruby-1.2.20 lib/tasks/vite.rake
vite_ruby-1.2.18 lib/tasks/vite.rake
vite_ruby-1.2.18.pre.rc1 lib/tasks/vite.rake
vite_ruby-1.2.17 lib/tasks/vite.rake
vite_ruby-1.2.16 lib/tasks/vite.rake
vite_ruby-1.2.15 lib/tasks/vite.rake
vite_ruby-1.2.14 lib/tasks/vite.rake
vite_ruby-1.2.13 lib/tasks/vite.rake
vite_ruby-1.2.12 lib/tasks/vite.rake
vite_ruby-1.2.11 lib/tasks/vite.rake
vite_ruby-1.2.10 lib/tasks/vite.rake
vite_ruby-1.2.9 lib/tasks/vite.rake