core3-utils

@wixc3/fs-utils on Github

Home > @wixc3/fs-utils > getRelativeImportPath

getRelativeImportPath() function

Creates relative import path for a file, stripping extension from JS/TS files.

Signature:

export declare function getRelativeImportPath(sourceFilePath: string, filePathToImport: string): string;

Parameters

Parameter Type Description
sourceFilePath string the file path of the component source code to be modified by new import lines
filePathToImport string the file path to be imported into the source file

Returns:

string