V
V
Vyacheslav Shevchenko2019-12-09 18:35:05
JavaScript
Vyacheslav Shevchenko, 2019-12-09 18:35:05

How to call a function from a webpack bundle?

There is a function that is written in the webpack bundle. I connect this bundle to the page and I need to call this function.
How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vyacheslav Shevchenko, 2019-12-09
@WebDev2030

In general, so far I have only one option - this is through window. You define your function in window, for example , and it is available everywhere, it is not even necessary to access it through window.foo (), you can just foo (); window.foo = function() {}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question