Method: ImportJS::Configuration#resolve_alias
- Defined in:
- lib/import_js/configuration.rb
#resolve_alias(variable_name, path_to_current_file) ⇒ ImportJS::JSModule?
54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/import_js/configuration.rb', line 54 def resolve_alias(variable_name, path_to_current_file) path = get('aliases')[variable_name] return unless path path = path['path'] if path.is_a? Hash if path_to_current_file && !path_to_current_file.empty? path = path.sub(/\{filename\}/, File.basename(path_to_current_file, '.*')) end JSModule.new(import_path: path) end |