@nxworker/workspace
Version:
Nx plugin providing generators for managing workspace files, including the move-file generator for safely moving files between projects while updating all imports
10 lines (9 loc) • 423 B
TypeScript
/**
* Strips file extension from import path for TypeScript and regular JavaScript files.
* Preserves extensions for ESM-specific files (.mjs, .mts, .cjs, .cts) as they are
* required by the ESM specification.
*
* @param importPath - The import path to process
* @returns The import path with extension stripped (or preserved for ESM files)
*/
export declare function stripFileExtension(importPath: string): string;