Class: Esbuild::BuildResult

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/esbuild/build_result.rb

Defined Under Namespace

Classes: Metafile, OutputFile

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response, state) ⇒ BuildResult

Returns a new instance of BuildResult.



57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/esbuild/build_result.rb', line 57

def initialize(response, state)
  @state = state
  @warnings = response["warnings"] # TODO: symbolize keys

  if response["outputFiles"]
    @output_files = response["outputFiles"].map { |f| OutputFile.new(f["path"], f["contents"]) }
  end

  if response["metafile"]
    @metafile = Metafile.new(response["metafile"])
  end
end

Instance Attribute Details

#metafileObject (readonly)

Returns the value of attribute metafile.



54
55
56
# File 'lib/esbuild/build_result.rb', line 54

def metafile
  @metafile
end

#output_filesObject (readonly)

Returns the value of attribute output_files.



53
54
55
# File 'lib/esbuild/build_result.rb', line 53

def output_files
  @output_files
end

#warningsObject (readonly)

Returns the value of attribute warnings.



52
53
54
# File 'lib/esbuild/build_result.rb', line 52

def warnings
  @warnings
end