Fix minimal details

This commit is contained in:
prototypa
2022-09-04 00:56:24 -04:00
parent 570cf904c4
commit 1cf25d6b43
44 changed files with 757 additions and 641 deletions

22
src/utils/directories.js Normal file
View File

@ -0,0 +1,22 @@
import path from "path";
import { fileURLToPath } from "url";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
/** */
export const getProjectRootDir = () => {
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) => {
if (filepath) {
return filepath.replace(__srcFolder, "");
}
return null;
};