Sha256: fe741f18e44a6ea69cf84172dccdf5db5d0a7dbd23a0ee33001cce8f4d59ba83

Contents?: true

Size: 705 Bytes

Versions: 1

Compression:

Stored size: 705 Bytes

Contents

namespace :vite do
  task init: :environment do
    Rake::Task["vite:init"].invoke
  end

  desc "Removes compiled assets"
  task clobber: :environment do
    build_dir = Rails.root.join(ViteRb.config.build_dir)
    output_dir = File.join(build_dir, ViteRb.config.output_dir)
    command = "rm -rf #{output_dir}"
    logger = Logger.new(STDOUT)
    logger.info(command)
    system(command)
  end

  task build: :environment do
    Rake::Task["vite:build"].invoke
  end

  task dev: :environment do
    Rake::Task["vite:dev"].invoke
  end
end

Rake::Task["assets:precompile"].enhance do
  Rake::Task["vite:build"].invoke
end

Rake::Task["assets:clobber"].enhance do
  Rake::Task["vite:clobber"].invoke
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vite_rb-0.0.1.alpha1 lib/tasks/rails.rake