microsoft / vscode-loader

An universal Asynchronous Module Definition (AMD) Loader developed primarily to load VSCode's sources.
Other
170 stars 55 forks source link

feature: set `amdLoaderGlobal` to `globalThis` in case `this` is not defined #58

Closed SimonSiefke closed 3 months ago

SimonSiefke commented 6 months ago

Helps with https://github.com/microsoft/vscode/issues/160416.

This PR changes the _amdLoaderGlobal to fall back to globalThis when this is undefined. This would be useful for using the AMD loader with ESM, because this at the top level of an ESM module is undefined.

alexdima commented 3 months ago

Thank you!