Module: Decidim::Webpacker

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

Defined Under Namespace

Modules: Runner, ThreadSafeCompiler Classes: Configuration

Class Method Summary collapse

Class Method Details

.configurationObject



10
11
12
# File 'lib/decidim/webpacker.rb', line 10

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

.register_entrypoints(entrypoints) ⇒ Object



22
23
24
# File 'lib/decidim/webpacker.rb', line 22

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

.register_path(path, prepend: false) ⇒ Object



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

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



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

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