lib/sewing_kit/webpack/dev.rb in sewing_kit-0.4.6 vs lib/sewing_kit/webpack/dev.rb in sewing_kit-0.5.0

- old
+ new

@@ -8,65 +8,22 @@ detach end private - def command - cmd = [ - 'node_modules/.bin/sewing-kit', - 'dev', - '--config-file', - 'config/sewing-kit.config.js', - '--target', - 'client', - '--env', - node_env - ] - - if hmr? - cmd += ['--hot', '--hot-host', hot_host] - else - cmd += ['--lazy', '--super-speed'] - end - - cmd += ['--verbose'] if ::Rails.configuration.sewing_kit.webpack.verbose - - cmd - end - def spawn Kernel.spawn( - { 'NODE_ENV' => node_env }, - *command, + { 'NODE_ENV' => 'development' }, + 'node_modules/.bin/sewing-kit', + 'dev', chdir: Rails.root.to_s, out: $stdout, err: $stderr, ) || exit(1) end def detach Process.detach pid - end - - def hmr? - @hmr ||= ENV['SK_DISABLE_HMR'] != 'true' - end - - def hot_host - if host = ::Rails.configuration.sewing_kit.webpack.asset_host - if host.is_a?(Proc) || host.respond_to?(:call) - host.call(nil, nil) - else - host - end - else - "/" - end - end - - private - def node_env - ENV['NODE_ENV'] || Rails.env.to_s end end end end