(code, chunk, opts)
| 646 | // Only ESM environments necessitate globalThis, and UMD bundles can't be properly loaded as ESM. |
| 647 | // So we remove the globalThis check, replacing it with `this||self` to match Rollup 1's output: |
| 648 | renderChunk(code, chunk, opts) { |
| 649 | if (opts.format === 'umd') { |
| 650 | // minified: |
| 651 | code = code.replace( |
| 652 | /([a-zA-Z$_]+)="undefined"!=typeof globalThis\?globalThis:(\1\|\|self)/, |
| 653 | '$2', |
| 654 | ); |
| 655 | // unminified: |
| 656 | code = code.replace( |
| 657 | /(global *= *)typeof +globalThis *!== *['"]undefined['"] *\? *globalThis *: *(global *\|\| *self)/, |
| 658 | '$1$2', |
| 659 | ); |
| 660 | return { code, map: null }; |
| 661 | } |
| 662 | }, |
| 663 | // Grab size info before writing files to disk: |
| 664 | writeBundle(_, bundle) { |
| 665 | config._sizeInfo = Promise.all( |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…