Initial commit

This commit is contained in:
Akilan Selvacoumar
2023-02-12 22:29:37 +00:00
committed by GitHub
commit ba5d6d24ef
99 changed files with 4904 additions and 0 deletions

18
src/utils/directories.ts Normal file
View File

@@ -0,0 +1,18 @@
import path from 'path';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
/** */
export const getProjectRootDir = (): string => {
const mode = import.meta.env.MODE;
return mode === 'production' ? path.join(__dirname, '../') : path.join(__dirname, '../../');
};
const __srcFolder = path.join(getProjectRootDir(), '/src');
/** */
export const getRelativeUrlByFilePath = (filepath: string): string => {
return filepath.replace(__srcFolder, '');
};