Reputation: 1367
i am hoping for some webpack option (or loader) like bare
in coffee
which removes the top-level function wrapper and expose the variables for convenience in debugging.
Upvotes: 1
Views: 1994
Reputation: 1367
script-loader evaluates the required module in the global context. Essentially it generates eval(source)
in the global context in the output bundled javascript file. Beware to avoid setting use strict
otherwise the eval would create its own scope (instead of using the global context).
Upvotes: 1