Class: Webpacker::Remote
- Inherits:
-
Instance
- Object
- Instance
- Webpacker::Remote
- Defined in:
- lib/webpacker/remote.rb
Defined Under Namespace
Classes: Error
Instance Method Summary collapse
- #config ⇒ Object
-
#env ⇒ Object
right now this only supports builds done ahead of time.
-
#initialize(root_path: nil, config_path: nil, **config_content) ⇒ Remote
constructor
rubocop:disable Lint/MissingSuper.
-
#manifest ⇒ Object
rubocop:enable Lint/MissingSuper.
Constructor Details
#initialize(root_path: nil, config_path: nil, **config_content) ⇒ Remote
rubocop:disable Lint/MissingSuper
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/webpacker/remote.rb', line 16 def initialize(root_path: nil, config_path: nil, **config_content) # deliberately not calling `super` just emulating what's done there # otherwise defaults in super initialize would call `Rails` # let's unbind the gem from rails @config_path = config_path @root_path = root_path # additions @config_content = config_content.symbolize_keys # fetch manifest eagerly to fail fast in initiazer unless cache_manifest: false manifest.manifest_data if @config_content.fetch(:cache_manifest, true) end |
Instance Method Details
#config ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/webpacker/remote.rb', line 34 def config @config ||= Webpacker::Remote::Configuration.new( root_path: root_path, config_path: config_path, **config_content ) end |
#env ⇒ Object
right now this only supports builds done ahead of time
43 44 45 |
# File 'lib/webpacker/remote.rb', line 43 def env 'production' end |
#manifest ⇒ Object
rubocop:enable Lint/MissingSuper
30 31 32 |
# File 'lib/webpacker/remote.rb', line 30 def manifest @manifest ||= Webpacker::Remote::Manifest.new(self) end |