How do I access the global object (window) using webpack?

后端 未结 3 1442
说谎
说谎 2021-02-12 14:34

I\'m trying to interface ActionScript with JavaScript using ExternalInterface and webpack.

ExternalInterface can only provoked (call

3条回答
  •  后悔当初
    2021-02-12 15:25

    You do have access to window object from your webpacked script. Webpack does not interfere with it since the wrapper function only injects module, exports and __webpack_require__ arguments.

    Try it writing a script with a single line accessing window object and then check out the output script.

    Your assignment should work, unless the execution never reaches it or some loader is altering the relevant code.

提交回复
热议问题