Class: WebpackNative::Railtie

Inherits:
Rails::Railtie
  • Object
show all
Defined in:
lib/webpack_native/railtie.rb

Instance Method Summary collapse

Instance Method Details

#start_webpackObject


46
47
48
49
50
51
52
53
54
# File 'lib/webpack_native/railtie.rb', line 46

def start_webpack
  Mutex.new.synchronize do
    Dir.chdir "#{Rails.root}/app/webpack_native" do
      # %x{ ./bin/webpack --watch --colors --progress }
      runner = WebpackNative::Runner.new('npm run build')
      runner.run
    end
  end
end