Joffrey
05/21/2020, 9:47 AMgildor
05/21/2020, 10:03 AMgildor
05/21/2020, 10:03 AMJoffrey
05/21/2020, 10:03 AMgildor
05/21/2020, 10:05 AMJoffrey
05/21/2020, 10:05 AMprocess.env.NODE_ENV
also available from the browser? How can I access that from Kotlin?gildor
05/21/2020, 10:06 AMJoffrey
05/21/2020, 10:07 AMprocess
global variable as an external myself? Or is it somewhere in Kotlin/JS?gildor
05/21/2020, 10:08 AMgildor
05/21/2020, 10:08 AMJoffrey
05/21/2020, 10:10 AMprocess
itself was something more general than just webpack, that’s why I expected some existing declaration from Kotlin/JS.Joffrey
05/21/2020, 10:10 AMgildor
05/21/2020, 10:24 AMJoffrey
05/21/2020, 10:27 AMwindow
and the likes, which is AFAIU something that’s provided by the browser, not in the source code. Somehow I imagined process
to fall in the same category, given its name, but I just checked and it’s not there in the browser 😄Varun Jayaraman
05/25/2020, 7:40 AMVarun Jayaraman
05/25/2020, 7:40 AMwindow
. For instance, if you didn't use webpack and you just ran some arbitray javascript in the browser and did the following:
var x = 4;
that would technically do window.x = 4
in the browser (note: not in node). That's just how javascript works).
webpack and stuff bundle your modules into scopes so that everything gets scoped to a function and there are no true globals. but you can still choose to inject globals on window if you want to with webpack, or you can set them manually from your code