tsup
Version:
Bundle your TypeScript library with no config, powered by esbuild
10 lines (7 loc) • 312 B
JavaScript
// Shim globals in esm bundle
import { fileURLToPath } from 'url'
import path from 'path'
const getFilename = () => fileURLToPath(import.meta.url)
const getDirname = () => path.dirname(getFilename())
export const __dirname = /* @__PURE__ */ getDirname()
export const __filename = /* @__PURE__ */ getFilename()