module SewingKit module Webpack class Dev attr_accessor :pid def start @pid = spawn detach end private def spawn Kernel.spawn( { 'NODE_ENV' => 'development', 'BLUEBIRD_DEBUG' => 0, 'BLUEBIRD_LONG_STACK_TRACES' => 0, }, 'node_modules/.bin/sewing-kit', 'dev', chdir: Rails.root.to_s, out: $stdout, err: $stderr, ) || exit(1) end def detach Process.detach pid end end end end