Using the Web Serial API, create a utility (/src/utils/) that allows compiled code to be sent over to Arduino.
This is only supported within certain browsers - check for the navigator.serial property and enable it as such.
Consider using the avrgirl-arduino or the avrbro library, however avrgirl seems more maintained.