mirror of
https://github.com/egoist/tsup.git
synced 2025-12-08 20:35:58 +00:00
BREAKING CHANGE: Code splitting now only works for esm format (default output format is `cjs`), code splitting with cjs format is not supported by esbuild, and our workaround is kinda buggy, so we reverted that decision.
6 lines
242 B
JavaScript
6 lines
242 B
JavaScript
export const importMetaUrlShim =
|
|
typeof document === 'undefined'
|
|
? new (require('u' + 'rl').URL)('file:' + __filename).href
|
|
: (document.currentScript && document.currentScript.src) ||
|
|
new URL('main.js', document.baseURI).href
|