I am currently starting to use webpack for my website and I have a question.
I currently have a html page that includes my javascript bundle and has some onclick
functions in buttons embedded in the html. I would like to keep the functionality of these buttons and the onclick
, but currently I have not found a way to do this. Obviously, if I try to minify the javascript functions, the name of the function would change and it won't work.
Here's an example, where the bundle produced by webpack is included in the html file:
<button onclick="foo("bar")">test</button>
and currently foo
is undefined.
I have tried using html webpack plugin without success.
Is there any way to do this?