@ima/dev-utils
Version:
IMA.js dev utils used used mainly in @ima/cli and other dev-related utilities.
27 lines (26 loc) • 860 B
TypeScript
export interface CompileError {
name: string;
message: string;
fileUri?: string;
line?: number;
column?: number;
}
declare const RE_FILE_PATH_REGEX: RegExp;
/**
* Parsers error location from error.loc string from webpack stats.
*
* @param {string?} errorLocation Error location (line:column) string.
* @returns { line?: number; column?: number; } parsed line & column.
*/
declare function extractErrorLoc(errorLocation?: string): {
line?: number;
column?: number;
};
/**
* Extracts fileUri from module identifier string, containing used loaders.
* The fileUri should always be at the end, separated by ! character.
*
* @param {string} moduleIdentifier webpack resource query.
*/
declare function extractFileUri(moduleIdentifier: string): string | undefined;
export { RE_FILE_PATH_REGEX, extractErrorLoc, extractFileUri };