Sha256: e6f8d80d53fc79d808fe293634ebc384ce9c0e9fd51c39b39678824ccc372bcf

Contents?: true

Size: 1.09 KB

Versions: 17

Compression:

Stored size: 1.09 KB

Contents

require "active_support/core_ext/module/attribute_accessors"
require "active_support/core_ext/string/inquiry"
require "active_support/logger"
require "active_support/tagged_logging"

module Webpacker
  extend self

  def instance=(instance)
    @instance = instance
  end

  def instance
    @instance ||= Webpacker::Instance.new
  end

  def with_node_env(env)
    original = ENV["NODE_ENV"]
    ENV["NODE_ENV"] = env
    yield
  ensure
    ENV["NODE_ENV"] = original
  end

  def ensure_log_goes_to_stdout
    old_logger = Webpacker.logger
    Webpacker.logger = Logger.new(STDOUT)
    yield
  ensure
    Webpacker.logger = old_logger
  end

  delegate :logger, :logger=, :env, :inlining_css?, to: :instance
  delegate :config, :compiler, :manifest, :commands, :dev_server, to: :instance
  delegate :bootstrap, :clean, :clobber, :compile, to: :commands
end

require "webpacker/instance"
require "webpacker/env"
require "webpacker/configuration"
require "webpacker/manifest"
require "webpacker/compiler"
require "webpacker/commands"
require "webpacker/dev_server"

require "webpacker/railtie" if defined?(Rails)

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
shakapacker-6.5.0 lib/webpacker.rb
shakapacker-6.4.1 lib/webpacker.rb
shakapacker-6.4.0 lib/webpacker.rb
shakapacker-6.3.0 lib/webpacker.rb
shakapacker-6.3.0.pre.rc.1 lib/webpacker.rb
shakapacker-6.2.1 lib/webpacker.rb
shakapacker-6.2.0 lib/webpacker.rb
shakapacker-6.1.1 lib/webpacker.rb
shakapacker-6.1.0 lib/webpacker.rb
shakapacker-6.1.0.beta.0 lib/webpacker.rb
shakapacker-6.0.2 lib/webpacker.rb
shakapacker-6.0.1 lib/webpacker.rb
shakapacker-6.0.0 lib/webpacker.rb
shakapacker-6.0.0.rc.14 lib/webpacker.rb
shakapacker-6.0.0.rc.13 lib/webpacker.rb
shakapacker-6.0.0.rc.12 lib/webpacker.rb
shakapacker-6.0.0.rc.6 lib/webpacker.rb