UNPKG

463 BJavaScriptView Raw
1import { pathToFileUrl, resolveDirectoryUrl } from "./urlHelpers.js"
2
3let jsenvBundlingDirectoryUrl
4if (typeof __filename === "string") {
5 jsenvBundlingDirectoryUrl = resolveDirectoryUrl(
6 // get ride of dist/node/main.js
7 "../../",
8 pathToFileUrl(__filename),
9 )
10} else {
11 jsenvBundlingDirectoryUrl = resolveDirectoryUrl(
12 // get ride of src/jsenvBundlingDirectoryUrl.js
13 "../",
14 import.meta.url,
15 )
16}
17
18export { jsenvBundlingDirectoryUrl }