Class: Webpacker::Configuration
- Inherits:
-
Object
- Object
- Webpacker::Configuration
- Defined in:
- lib/webpacker/configuration.rb
Instance Attribute Summary collapse
-
#config_path ⇒ Object
readonly
Returns the value of attribute config_path.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#root_path ⇒ Object
readonly
Returns the value of attribute root_path.
Instance Method Summary collapse
- #additional_paths ⇒ Object
- #additional_paths_globbed ⇒ Object
- #cache_manifest? ⇒ Boolean
- #cache_path ⇒ Object
- #check_yarn_integrity=(value) ⇒ Object
- #compile? ⇒ Boolean
- #dev_server ⇒ Object
- #extensions ⇒ Object
- #extract_css? ⇒ Boolean
-
#initialize(root_path:, config_path:, env:) ⇒ Configuration
constructor
A new instance of Configuration.
- #public_manifest_path ⇒ Object
- #public_output_path ⇒ Object
- #public_path ⇒ Object
- #source_entry_path ⇒ Object
- #source_path ⇒ Object
- #source_path_globbed ⇒ Object
- #webpack_compile_output? ⇒ Boolean
Constructor Details
#initialize(root_path:, config_path:, env:) ⇒ Configuration
Returns a new instance of Configuration.
8 9 10 11 12 |
# File 'lib/webpacker/configuration.rb', line 8 def initialize(root_path:, config_path:, env:) @root_path = root_path @config_path = config_path @env = env end |
Instance Attribute Details
#config_path ⇒ Object (readonly)
Returns the value of attribute config_path.
6 7 8 |
# File 'lib/webpacker/configuration.rb', line 6 def config_path @config_path end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
6 7 8 |
# File 'lib/webpacker/configuration.rb', line 6 def env @env end |
#root_path ⇒ Object (readonly)
Returns the value of attribute root_path.
6 7 8 |
# File 'lib/webpacker/configuration.rb', line 6 def root_path @root_path end |
Instance Method Details
#additional_paths ⇒ Object
30 31 32 |
# File 'lib/webpacker/configuration.rb', line 30 def additional_paths fetch(:additional_paths) + resolved_paths end |
#additional_paths_globbed ⇒ Object
34 35 36 |
# File 'lib/webpacker/configuration.rb', line 34 def additional_paths_globbed additional_paths.map { |p| globbed_path_with_extensions(p) } end |
#cache_manifest? ⇒ Boolean
54 55 56 |
# File 'lib/webpacker/configuration.rb', line 54 def cache_manifest? fetch(:cache_manifest) end |
#cache_path ⇒ Object
58 59 60 |
# File 'lib/webpacker/configuration.rb', line 58 def cache_path root_path.join(fetch(:cache_path)) end |
#check_yarn_integrity=(value) ⇒ Object
66 67 68 |
# File 'lib/webpacker/configuration.rb', line 66 def check_yarn_integrity=(value) warn "Webpacker::Configuration#check_yarn_integrity=(value) has been deprecated. The integrity check has been removed from Webpacker so changing this setting will have no effect." end |
#compile? ⇒ Boolean
18 19 20 |
# File 'lib/webpacker/configuration.rb', line 18 def compile? fetch(:compile) end |
#dev_server ⇒ Object
14 15 16 |
# File 'lib/webpacker/configuration.rb', line 14 def dev_server fetch(:dev_server) end |
#extensions ⇒ Object
62 63 64 |
# File 'lib/webpacker/configuration.rb', line 62 def extensions fetch(:extensions) end |
#extract_css? ⇒ Boolean
74 75 76 |
# File 'lib/webpacker/configuration.rb', line 74 def extract_css? fetch(:extract_css) end |
#public_manifest_path ⇒ Object
50 51 52 |
# File 'lib/webpacker/configuration.rb', line 50 def public_manifest_path public_output_path.join("manifest.json") end |
#public_output_path ⇒ Object
46 47 48 |
# File 'lib/webpacker/configuration.rb', line 46 def public_output_path public_path.join(fetch(:public_output_path)) end |
#public_path ⇒ Object
42 43 44 |
# File 'lib/webpacker/configuration.rb', line 42 def public_path root_path.join(fetch(:public_root_path)) end |
#source_entry_path ⇒ Object
38 39 40 |
# File 'lib/webpacker/configuration.rb', line 38 def source_entry_path source_path.join(fetch(:source_entry_path)) end |
#source_path ⇒ Object
22 23 24 |
# File 'lib/webpacker/configuration.rb', line 22 def source_path root_path.join(fetch(:source_path)) end |
#source_path_globbed ⇒ Object
26 27 28 |
# File 'lib/webpacker/configuration.rb', line 26 def source_path_globbed globbed_path_with_extensions(source_path.relative_path_from(root_path)) end |
#webpack_compile_output? ⇒ Boolean
70 71 72 |
# File 'lib/webpacker/configuration.rb', line 70 def webpack_compile_output? fetch(:webpack_compile_output) end |