Home Reference Source Test Repository
public class | source

PackageImporter

Import packages from the node_modules directory.

Test:

Constructor Summary

Public Constructor
public

constructor(options: Object)

Member Summary

Public Members
public

Method Summary

Public Methods
public

Clean a node sass import url.

public

Asynchronously resolve the path to a node-sass import url.

public

Find the first matching key in a package.json file and set it as value for the main field.

public

Synchronously resolve the path to a node-sass import url.

public

Create url variants for partial file matching (e.g.

Public Constructors

public constructor(options: Object) source

Params:

NameTypeAttributeDescription
options Object

Configuration options.

Public Members

public options: Object source

Public Methods

public cleanUrl(url: string): string source

Clean a node sass import url.

Params:

NameTypeAttributeDescription
url string

Import url from node-sass.

Return:

string

Cleaned url.

Test:

public resolve(url: string): Promise source

Asynchronously resolve the path to a node-sass import url.

Params:

NameTypeAttributeDescription
url string

Import url from node-sass.

Return:

Promise

Promise for a fully resolved import url.

Test:

public resolveFilter(pkg: Object): Object source

Find the first matching key in a package.json file and set it as value for the main field.

Params:

NameTypeAttributeDescription
pkg Object

Contents of a package.json.

Return:

Object

A package.json object with a replaced main value.

Test:

public resolveSync(url: string): string source

Synchronously resolve the path to a node-sass import url.

Params:

NameTypeAttributeDescription
url string

Import url from node-sass.

Return:

string

Fully resolved import url or null.

Test:

public urlVariants(url: string): Array source

Create url variants for partial file matching (e.g. _file.scss).

Params:

NameTypeAttributeDescription
url string

Import url from node-sass.

Return:

Array

Multiple variants of sass file names.

Test: