lib/sewing_kit/webpack/dev.rb in sewing_kit-0.96.0 vs lib/sewing_kit/webpack/dev.rb in sewing_kit-0.97.0
- old
+ new
@@ -81,16 +81,16 @@
SewingKit.configuration.log_level.to_s
end
end
def options
- development_options = SewingKit.configuration.development_options
- return [] unless development_options
+ development_options = SewingKit.configuration.development_options || {}
+ focus = focus_sections
development_options
.reject { |key| key == :heap }
- .map { |key, value| ["--#{key}", value] }.flatten
+ .map { |key, value| ["--#{key.to_s.tr('_', '-')}", value] }.flatten + focus.flatten
end
def log_level_from_rails
case Rails.logger.level
when 0
@@ -104,9 +104,17 @@
end
end
def debug_mode?
!ENV['SK_DEBUG'].nil?
+ end
+
+ def focus_sections
+ return [] if ENV['SK_FOCUS'].nil?
+
+ ENV['SK_FOCUS']
+ .split(',')
+ .map { |section| ["--focus", section] }
end
end
end
end