Class: Railpack::EsbuildBundler

Inherits:
NpmBasedBundler show all
Defined in:
lib/railpack/bundlers/esbuild_bundler.rb

Instance Attribute Summary

Attributes inherited from Bundler

#config

Instance Method Summary collapse

Methods inherited from NpmBasedBundler

#add, #exec, #install!, #installed?, #package_manager, #remove, #version

Methods inherited from Bundler

#add, #commands, #exec, #initialize, #install!, #installed?, #name, #remove, #version

Constructor Details

This class inherits a constructor from Railpack::Bundler

Instance Method Details

#base_command ⇒ Object



3
4
5
# File 'lib/railpack/bundlers/esbuild_bundler.rb', line 3

def base_command
  "esbuild"
end

#build!(args = []) ⇒ Object



16
17
18
19
# File 'lib/railpack/bundlers/esbuild_bundler.rb', line 16

def build!(args = [])
  full_args = build_command_args(:build, args)
  execute(full_args)
end

#default_commands ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/railpack/bundlers/esbuild_bundler.rb', line 7

def default_commands
  {
    build: base_command,
    watch: base_command,
    install: "#{package_manager} install",
    version: "#{base_command} --version"
  }
end

#watch(args = []) ⇒ Object



21
22
23
24
# File 'lib/railpack/bundlers/esbuild_bundler.rb', line 21

def watch(args = [])
  full_args = build_command_args(:watch, args)
  execute(full_args)
end