Sha256: bd6ba1c160a12d094840a08136a3c14b9508646a3933c28a86aa0988ba7217fc

Contents?: true

Size: 1.09 KB

Versions: 29

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 = ActiveSupport::Logger.new(STDOUT)
    yield
  ensure
    Webpacker.logger = old_logger
  end

  delegate :logger, :logger=, :env, 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

29 entries across 29 versions & 2 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/webpacker-5.4.4/lib/webpacker.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/webpacker-5.4.4/lib/webpacker.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/webpacker-5.4.4/lib/webpacker.rb
webpacker-5.4.4 lib/webpacker.rb
webpacker-5.4.3 lib/webpacker.rb
webpacker-5.4.2 lib/webpacker.rb
webpacker-5.4.1 lib/webpacker.rb
webpacker-5.4.0 lib/webpacker.rb
webpacker-5.3.0 lib/webpacker.rb
webpacker-5.2.2 lib/webpacker.rb
webpacker-6.0.0.beta.7 lib/webpacker.rb
webpacker-6.0.0.beta.6 lib/webpacker.rb
webpacker-6.0.0.beta.5 lib/webpacker.rb
webpacker-6.0.0.beta.4 lib/webpacker.rb
webpacker-6.0.0.beta.3 lib/webpacker.rb
webpacker-6.0.0.beta.2 lib/webpacker.rb
webpacker-6.0.0.beta.1 lib/webpacker.rb
webpacker-6.0.0.beta lib/webpacker.rb
webpacker-6.0.0.pre.2 lib/webpacker.rb
webpacker-6.0.0.pre.1 lib/webpacker.rb