Sha256: ba806dda217ef0ddec618df44da4d4bbb22bb6bf22cc91dce5cba9b6d069c260

Contents?: true

Size: 731 Bytes

Versions: 6

Compression:

Stored size: 731 Bytes

Contents

# frozen_string_literal: true

require "hanami/cli"
require "snowpack/cli/application/command"

module Snowpack
  module CLI
    module Application
      module Commands
        module Assets
          class Compile < Command
            desc "Compiles assets"

            def call(**)
              measure "assets compiled into #{compiled_assets_path}" do
                `yarn run build-production` # TODO use shell helper here
              end
            end

            private

            def compiled_assets_path
              File.join(application.root, "public/assets")
            end
          end
        end

        register "assets compile", Assets::Compile, aliases: ["precompile"]
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
snowpack-1.0.0.alpha7 lib/snowpack/cli/application/commands/assets/compile.rb
snowpack-1.0.0.alpha6 lib/snowpack/cli/application/commands/assets/compile.rb
snowpack-1.0.0.alpha5 lib/snowpack/cli/application/commands/assets/compile.rb
snowpack-1.0.0.alpha4 lib/snowpack/cli/application/commands/assets/compile.rb
snowpack-1.0.0.alpha3 lib/snowpack/cli/application/commands/assets/compile.rb
snowpack-1.0.0.alpha2 lib/snowpack/cli/application/commands/assets/compile.rb