webpack-provider.ts 682 B

123456789101112131415161718
  1. // This file provides the global, process and Buffer variables to internal
  2. // Electron code once they have been deleted from the global scope.
  3. //
  4. // It does this through the ProvidePlugin in the webpack.config.base.js file
  5. // Check out the Module.wrapper override in renderer/init.ts for more
  6. // information on how this works and why we need it
  7. // Rip global off of window (which is also global) so that webpack doesn't
  8. // auto replace it with a looped reference to this file
  9. const _global = typeof globalThis !== 'undefined' ? globalThis.global : (self || window).global;
  10. const process = _global.process;
  11. const Buffer = _global.Buffer;
  12. export {
  13. _global,
  14. process,
  15. Buffer
  16. };