Module: Rails::Webpack::Actions

Defined in:
lib/rails/webpack/actions.rb

Instance Method Summary collapse

Instance Method Details

#dependencies(&block) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/rails/webpack/actions.rb', line 2

def dependencies(&block)
  collections = Rails::Webpack::DependencyCollection.new Rails::Webpack::Config
  collections.instance_eval &block
  processor = collections.processor

  processor.process([
    {
      matcher: 'bower.dependencies',
      category: :bower,
      text: 'dependencies'
    },
    {
      matcher: 'npm.dependencies',
      category: :npm,
      text: 'dependencies'
    },
    {
      matcher: 'npm.develop_dependencies',
      category: :npm_develop,
      text: 'develop_dependencies'
    }
  ])

  log :webpack, 'config/webpack.yml'
  processor.flush
end