jantimon/html-webpack-plugin

How to add `onerror` event to the generated script tag?

Closed this issue · 1 comments

This is a very powerful plugin!

But I'm so sad that I have a problem.

How can I insert onerror property to my target script tag which is generated by this plugin?

Just like this:

<script defer="defer" src="assets/js/vender.c3803732.bundle.js" **onerror="handleError()"**></script>

You can create a custom plugin if you need it, look at our docs how to change HTML content - https://github.com/jantimon/html-webpack-plugin?tab=readme-ov-file#beforeemit-hook

feel free to feedback