How to access require, from an HTML file, when contextIsolation is set to true

I’m trying to get electron into this HTML file, but require is undefined:

    const electron = require("electron");
    const {icpRenderer} = electron;

    const form = document.querySelector("form");
    form.addEventListener("submit", submitForm);

    function submitForm(e){
        const item = document.querySelector("#item").value;

I have nodeIntegration as True, and contextIsolation as True for the web preferences which is used to prevent security warnings. How can I get require through this file?