Sha256: 7330ba5fac25653473e142a7820006ccd9111094267b62a255c70e4a53c84d9f

Contents?: true

Size: 760 Bytes

Versions: 5

Compression:

Stored size: 760 Bytes

Contents

# frozen_string_literal: true
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
      is_development = Rails.env.development? && ENV['SK_SIMULATE_PRODUCTION'] != '1'
      if is_development && (Rails.const_defined?(:Server) || ENV['SK_FORCE_DEV_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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sewing_kit-0.29.1 lib/sewing_kit/railtie.rb
sewing_kit-0.28.0 lib/sewing_kit/railtie.rb
sewing_kit-0.27.3 lib/sewing_kit/railtie.rb
sewing_kit-0.27.2 lib/sewing_kit/railtie.rb
sewing_kit-0.27.1 lib/sewing_kit/railtie.rb