Class: SewingKit::Webpack::Manifest

Inherits:
Object
  • Object
show all
Defined in:
lib/sewing_kit/webpack/manifest.rb,
lib/sewing_kit/webpack/manifest/base.rb,
lib/sewing_kit/webpack/manifest/production.rb,
lib/sewing_kit/webpack/manifest/development.rb,
lib/sewing_kit/webpack/manifest/test_with_no_assets.rb

Overview

Webpack manifest loading, caching & entry point retrieval

Defined Under Namespace

Classes: Base, Development, ManifestLoadError, ManifestParseError, NodeSewingKitManifestMissing, OnlyUseInProductionError, Production, TestWithNoAssets

Class Method Summary collapse

Class Method Details

.asset_bundle_name(user_agent) ⇒ Object



40
41
42
# File 'lib/sewing_kit/webpack/manifest.rb', line 40

def asset_bundle_name(user_agent)
  instance.asset_bundle_name(user_agent)
end

.asset_dependencies(entrypoint_name, user_agent) ⇒ Object

:nodoc:



45
46
47
# File 'lib/sewing_kit/webpack/manifest.rb', line 45

def asset_dependencies(entrypoint_name, user_agent)
  instance.asset_dependencies(entrypoint_name, user_agent)
end

.clear_cache!Object



49
50
51
# File 'lib/sewing_kit/webpack/manifest.rb', line 49

def clear_cache!
  @instance = nil
end

.instanceObject



57
58
59
60
61
62
63
64
65
66
67
# File 'lib/sewing_kit/webpack/manifest.rb', line 57

def instance
  return Production.new if simulate_production?

  @instance ||= if mode == "development"
    Development.new
  elsif skip_assets?
    TestWithNoAssets.new
  else
    Production.new
  end
end

.manifestObject



53
54
55
# File 'lib/sewing_kit/webpack/manifest.rb', line 53

def manifest
  instance.manifest
end