Class: Webpacker::Commands

Inherits:
Object
  • Object
show all
Defined in:
lib/webpacker/commands.rb

Instance Method Summary collapse

Constructor Details

#initialize(webpacker) ⇒ Commands

Returns a new instance of Commands.



4
5
6
# File 'lib/webpacker/commands.rb', line 4

def initialize(webpacker)
  @webpacker = webpacker
end

Instance Method Details

#bootstrapObject



13
14
15
# File 'lib/webpacker/commands.rb', line 13

def bootstrap
  manifest.refresh
end

#clobberObject



8
9
10
11
# File 'lib/webpacker/commands.rb', line 8

def clobber
  config.public_output_path.rmtree if config.public_output_path.exist?
  config.cache_path.rmtree if config.cache_path.exist?
end

#compileObject



17
18
19
20
21
# File 'lib/webpacker/commands.rb', line 17

def compile
  compiler.compile.tap do |success|
    manifest.refresh if success
  end
end