expose-loader
Version:
expose loader module for webpack
30 lines (27 loc) • 702 B
JavaScript
;
// eslint-disable-next-line func-names
module.exports = function () {
if (typeof globalThis === "object") {
return globalThis;
}
var g;
try {
// This works if eval is allowed (see CSP)
// eslint-disable-next-line no-new-func
g = this || new Function("return this")();
} catch (e) {
// This works if the window reference is available
if (typeof window === "object") {
return window;
}
// This works if the self reference is available
if (typeof self === "object") {
return self;
}
// This works if the global reference is available
if (typeof global !== "undefined") {
return global;
}
}
return g;
}();