Created
October 4, 2023 13:11
-
-
Save Nekall/d768da511224cc430edc65c62c7726e3 to your computer and use it in GitHub Desktop.
Marre de redéclarer le __dirname partout.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { dirname, join } from 'node:path' | |
import { fileURLToPath } from 'node:url' | |
export const __dirname = join(dirname(fileURLToPath(import.meta.url)), '..') // '..' dans le cas ou il est dans un dossier utils par exemple |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment