module Webpack

Public Class Methods

config() click to toggle source

@return [Webpack::Configuration]

# File lib/webpack.rb, line 7
def config
  @config ||= Configuration.new
end
configure() { |config| ... } click to toggle source

@yield config @yieldparam [Webpack::Configuration] @example

Webpack.configure do |config|
  config.port = 4000
  config.path = '/assets'
end
# File lib/webpack.rb, line 18
def configure
  yield config
  config.validate!
end
fetch_entry(name, ext) click to toggle source

@param name [String] @param ext [String] @return [String]

# File lib/webpack.rb, line 35
def fetch_entry(name, ext)
  entries = @entries[name]
  entry = entries[ext] if entries
  fail "#{name}.#{ext} does not exist" unless entry
  entry
end
fetch_static_file(path) click to toggle source

@param path [String] @return [String]

# File lib/webpack.rb, line 49
def fetch_static_file(path)
  static_file = @static_files[path]
  fail "#{path} does not exist" unless static_file
  static_file
end
load_entries(entries) click to toggle source

@param entries [Hash]

# File lib/webpack.rb, line 28
def load_entries(entries)
  @entries = entries
end
load_static_files(static_files) click to toggle source

@param static_files [Hash]

# File lib/webpack.rb, line 43
def load_static_files(static_files)
  @static_files = static_files
end
reset() click to toggle source
# File lib/webpack.rb, line 23
def reset
  @config = nil
end