Sha256: 08bba2abbe93c5aef48596a0dc38352d95d45926b95ef3aa860a24fab9602089

Contents?: true

Size: 537 Bytes

Versions: 6

Compression:

Stored size: 537 Bytes

Contents

# frozen_string_literal: true

module Proscenium
  class Middleware
    class Esbuild < Base
      def attempt
        benchmark :esbuild do
          render_response build("#{cli} --root #{root} #{path}")
        end
      end

      private

      def path
        @request.path[1..]
      end

      def cli
        if ENV['PROSCENIUM_TEST']
          'deno run -q --import-map import_map.json -A lib/proscenium/compilers/esbuild.js'
        else
          Gem.bin_path 'proscenium', 'esbuild'
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
proscenium-0.1.0.alpha2-x86_64-linux lib/proscenium/middleware/esbuild.rb
proscenium-0.1.0.alpha2-x86_64-darwin lib/proscenium/middleware/esbuild.rb
proscenium-0.1.0.alpha2-arm64-darwin lib/proscenium/middleware/esbuild.rb
proscenium-0.1.0.alpha1-x86_64-linux lib/proscenium/middleware/esbuild.rb
proscenium-0.1.0.alpha1-x86_64-darwin lib/proscenium/middleware/esbuild.rb
proscenium-0.1.0.alpha1-arm64-darwin lib/proscenium/middleware/esbuild.rb