mirror of
https://github.com/duhanbalci/dexpr.git
synced 2026-07-02 08:29:16 +00:00
initial commit
This commit is contained in:
13
editor/node_modules/tsup/assets/cjs_shims.js
generated
vendored
Normal file
13
editor/node_modules/tsup/assets/cjs_shims.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
// Shim globals in cjs bundle
|
||||
// There's a weird bug that esbuild will always inject importMetaUrl
|
||||
// if we export it as `const importMetaUrl = ... __filename ...`
|
||||
// But using a function will not cause this issue
|
||||
|
||||
const getImportMetaUrl = () =>
|
||||
typeof document === "undefined"
|
||||
? new URL(`file:${__filename}`).href
|
||||
: (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
|
||||
? document.currentScript.src
|
||||
: new URL("main.js", document.baseURI).href;
|
||||
|
||||
export const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()
|
||||
Reference in New Issue
Block a user