Sha256: e37ec4d2b6f817aa8c1e079fe8186eca2b9f05dbdba4fba6d4dc2bfbd0953f97
Contents?: true
Size: 846 Bytes
Versions: 2
Compression:
Stored size: 846 Bytes
Contents
# frozen_string_literal: true require 'sewing_kit/webpack/webpack' module SewingKit module Webpack class Compiler def compile raise NodeSewingKitNotRunnable, node_env unless File.exist?('node_modules/.bin/sewing-kit') result = Kernel.system( { 'NODE_ENV' => node_env }, *command, chdir: Rails.root.to_s, out: $stdout, err: $stderr ) unless result puts "sewing-kit compile failed with error code #{$CHILD_STATUS}" exit(1) end result end private def command [ 'node_modules/.bin/sewing-kit', 'build', '--mode', node_env ].reject(&:empty?) end def node_env ENV['NODE_ENV'] || Rails.env.to_s end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
sewing_kit-0.28.0 | lib/sewing_kit/webpack/compiler.rb |
sewing_kit-0.27.3 | lib/sewing_kit/webpack/compiler.rb |