The vite build documentation gets the directory of vite.config.js
like this:
const __dirname = dirname(fileURLToPath(import.meta.url))
And I was curious why it’s being done like this. According to this question we can get the __dirname
directory via import.meta.dirname
for more recent versions of node, so is const __dirname = dirname(fileURLToPath(import.meta.url))
just an older way of doing it?