Class: Sass::NodePackageImporter

Inherits:
Object
  • Object
show all
Defined in:
lib/sass/node_package_importer.rb

Overview

The built-in Node.js package importer. This loads pkg: URLs from node_modules according to the standard Node.js resolution algorithm.

Instance Method Summary collapse

Constructor Details

#initialize(entry_point_directory) ⇒ NodePackageImporter

Returns a new instance of NodePackageImporter.

Parameters:

  • entry_point_directory (String)

    The directory where the Sass::NodePackageImporter should start when resolving ‘pkg:` URLs in sources other than files on disk.

Raises:

  • (ArgumentError)


11
12
13
14
15
# File 'lib/sass/node_package_importer.rb', line 11

def initialize(entry_point_directory)
  raise ArgumentError, 'entry_point_directory must be set' if entry_point_directory.nil?

  @entry_point_directory = File.absolute_path(entry_point_directory)
end