require 'rails' require 'rails/railtie' require 'sewing_kit/webpack/compiler' require 'sewing_kit/webpack/helper' require 'sewing_kit/webpack/dev' module SewingKit class Railtie < ::Rails::Railtie initializer "sewing_kit.initialize_webpack" do if Rails.env.development? && Rails.const_defined?(:Server) webpack_dev = SewingKit::Webpack::Dev.new webpack_dev.start end end config.after_initialize do ActiveSupport.on_load(:action_view) do include SewingKit::Webpack::Helper end end rake_tasks do load "tasks/sewing_kit.rake" end end end