# frozen_string_literal: true TEMPLATE_PATH = File.expand_path("../install/template.rb", File.dirname(__FILE__)) namespace :sewing_kit do desc "Install all of Shopify’s modern FED tooling" task :install do exec "bundle exec rails generate sewing_kit:install" end desc "Build webpack asset bundles" task build: :environment do compiler = SewingKit::Webpack::Compiler.new compiler.compile end namespace :server do desc "Starts the production server" task start: :environment do server = SewingKit::Webpack::Server.new server.start end end end if Rake::Task.task_defined?("assets:precompile") Rake::Task["assets:precompile"].enhance do Rake::Task["sewing_kit:build"].invoke end else Rake::Task.define_task("assets:precompile" => ["sewing_kit:build"]) end unless Rake::Task.task_defined?("assets:clean") namespace :assets do task :clean do # This empty task is to offer the same interface than sprockets and webpacker end end end