core3-utils

@wixc3/fs-utils on Github

Home > @wixc3/fs-utils > createImportPath

createImportPath() function

Returns relative import path if imported and target files are in the same package, otherwise returns a bare import specifier.

Signature:

export declare function createImportPath({ importedFilePath, targetFilePath, targetPackageJsonPath, fs, }: CreateImportPathArgs): string;

Parameters

Parameter Type Description
{ importedFilePath, targetFilePath, targetPackageJsonPath, fs, } [CreateImportPathArgs](/core3-utils/fs-utils.createimportpathargs.html)

Returns:

string