-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use globalThis code in place of global #24
Conversation
should just use
in top of their script runtime |
this is intended for use with a bundler which should handle this sort of thing, are you having problems somewhere |
I'm using webpack and targeting |
Webpack 100% provides a global shim, and will provide it once to be shared
by all your code, have you either turned this off? Or has web pack maybe
decided to break stuff by turning it off by default?
…On Thu, Sep 3, 2020, 11:16 AM Rachel Macfarlane ***@***.***> wrote:
I'm using webpack and targeting webworker. The bundler does not do any
sort of shim for global, in a webworker the only way to access the global
object is self.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#24 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAITRHZYX7DPC5KMY5HWIRDSD6XLFANCNFSM4O4YOTLA>
.
|
Perhaps unintentionally. IMO, I shouldn't have to fiddle with my bundler to get this code to run in a browser context, it should be able to do so without outside intervention. |
I know for a fact that this has worked with webpack in the past. So if it's
not working out of the box anymore that could be a webpack change that will
effect a lot of other libraries. I can look into it more but not until
after labor day.
…On Thu, Sep 3, 2020, 2:57 PM Rachel Macfarlane ***@***.***> wrote:
Perhaps unintentionally.
IMO, I shouldn't have to fiddle with my bundler to get this code to run in
a browser context, it should be able to do so without outside intervention.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#24 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAITRH2VWKQXDGLCLKHUVUDSD7RJHANCNFSM4O4YOTLA>
.
|
Thanks! Here's the webpack config I'm using, I may just be doing something stupid: https://github.com/microsoft/vscode/blob/616afa93e2da5a5a92b14863bab8b339b977edc4/extensions/microsoft-authentication/extension-browser.webpack.config.js That being said, I think it's pretty easy to misconfigure webpack, and it would be helpful to others if there wasn't direct |
what version of webpack is this ? |
4.43.0 |
I think you turned it off here |
If you don't intend to accept fixes for #22, please close it, then. |
Fixes #22