Class: Webpacker::Configuration
- Inherits:
-
FileLoader
- Object
- FileLoader
- Webpacker::Configuration
- Defined in:
- lib/webpacker/configuration.rb
Instance Attribute Summary
Attributes inherited from FileLoader
Class Method Summary collapse
- .config_path ⇒ Object
- .entry_path ⇒ Object
- .file_path ⇒ Object
- .manifest_path ⇒ Object
- .output_path ⇒ Object
- .paths ⇒ Object
- .source_path ⇒ Object
Methods inherited from FileLoader
Class Method Details
.config_path ⇒ Object
6 7 8 |
# File 'lib/webpacker/configuration.rb', line 6 def config_path Rails.root.join(paths.fetch(:config, "config/webpack")) end |
.entry_path ⇒ Object
10 11 12 |
# File 'lib/webpacker/configuration.rb', line 10 def entry_path Rails.root.join(source_path, paths.fetch(:entry, "packs")) end |
.file_path ⇒ Object
14 15 16 |
# File 'lib/webpacker/configuration.rb', line 14 def file_path Rails.root.join("config", "webpack", "paths.yml") end |
.manifest_path ⇒ Object
18 19 20 |
# File 'lib/webpacker/configuration.rb', line 18 def manifest_path Rails.root.join(output_path, "manifest.json") end |
.output_path ⇒ Object
22 23 24 |
# File 'lib/webpacker/configuration.rb', line 22 def output_path Rails.root.join(paths.fetch(:output, "public"), paths.fetch(:entry, "packs")) end |
.paths ⇒ Object
26 27 28 29 30 |
# File 'lib/webpacker/configuration.rb', line 26 def paths load if Rails.env.development? raise Webpacker::FileLoader::FileLoaderError.new("Webpacker::Configuration.load must be called first") unless instance instance.data end |
.source_path ⇒ Object
32 33 34 |
# File 'lib/webpacker/configuration.rb', line 32 def source_path Rails.root.join(paths.fetch(:source, "app/javascript")) end |