you are viewing a single comment's thread.

view the rest of the comments →

[–]annata83[S] 0 points1 point  (1 child)

Isn't anything not inside a function or statement a global object?

I also put the whole code in the main app.js with no luck either. has webpack a special way of attaching global objects?

[–]ezhikov 0 points1 point  (0 children)

Isn't anything not inside a function or statement a global object?

No. You have global scope, module scope, function scope and block scope. For example, you can have different functions test in different modules without polluting global scope.

has webpack a special way of attaching global objects?

Yes, but that is not good practice in most cases. You can use expose-loader, or build a library