Module: Decidim::Webpacker

Defined in:
lib/decidim/webpacker.rb,
lib/decidim/webpacker/runner.rb,
lib/decidim/webpacker/configuration.rb

Defined Under Namespace

Modules: Runner Classes: Configuration

Class Method Summary collapse

Class Method Details

.configurationObject



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

def self.configuration
  @configuration ||= Configuration.new
end

.register_entrypoints(entrypoints) ⇒ Object



20
21
22
# File 'lib/decidim/webpacker.rb', line 20

def self.register_entrypoints(entrypoints)
  configuration.entrypoints.merge!(entrypoints.stringify_keys)
end

.register_path(path, prepend: false) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/decidim/webpacker.rb', line 12

def self.register_path(path, prepend: false)
  if prepend
    configuration.additional_paths.unshift(path)
  else
    configuration.additional_paths.push(path)
  end
end

.register_stylesheet_import(import, type: :imports, group: :app) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/decidim/webpacker.rb', line 24

def self.register_stylesheet_import(import, type: :imports, group: :app)
  type = type.to_s
  key = group.to_s
  configuration.stylesheet_imports[type] ||= {}
  configuration.stylesheet_imports[type][key] ||= []
  configuration.stylesheet_imports[type][key].push(import)
end