FredKSchott / rollup-plugin-polyfill-node

A modern Node.js polyfill for your Rollup bundle.
Other
175 stars 55 forks source link

fix: skip global.js transform #17

Closed underfin closed 2 years ago

underfin commented 3 years ago

Description

Here is code of global ployfill, the code has global key words, it will transformed and add import '\0polyfill-node:global.js'. But it is a self import, so we need skip it.

export default (typeof global !== "undefined" ? global :
  typeof self !== "undefined" ? self :
  typeof window !== "undefined" ? window : {});
jacogr commented 3 years ago

Indeed, using it results in the following -

(!) Circular dependencies
polyfill-node:global.js -> polyfill-node:global.js

A look/merge at this proposed solution would be appreciated.

pkit commented 2 years ago

Aaand??