Class: Proscenium::Middleware::Esbuild

Inherits:
Base show all
Defined in:
lib/proscenium/middleware/esbuild.rb

Direct Known Subclasses

Engines, Runtime

Defined Under Namespace

Classes: CompileError

Instance Method Summary collapse

Methods inherited from Base

attempt, #initialize, #renderable!

Constructor Details

This class inherits a constructor from Proscenium::Middleware::Base

Instance Method Details

#attemptObject



22
23
24
25
26
27
# File 'lib/proscenium/middleware/esbuild.rb', line 22

def attempt
  render_response Builder.build_to_string(path_to_build, root: Rails.root.to_s,
                                                         base_url: @request.base_url)
rescue Builder::CompileError => e
  raise self.class::CompileError, { file: @request.fullpath, detail: e.message }, caller
end