Ok, so I have done this by far and it failed.
(function(d, script) {
script = d.createElement('script');
script.onload = function(){
// remote script has loaded
};
d.getElementsByTagName('head')[0].appendChild(script);
}(document));
import { jsPDF } from "jspdf";
// Default export is a4 paper, portrait, using millimeters for units
const doc = new jsPDF();
doc.text("Hello world!", 10, 10);
doc.save("a4.pdf");
According to error: "Cannot use import statement outside a module"
I looked for some other ways to replace import method but I failed. Spent quite some time on this haha.
By the way, you helped me get closer to this achievement. Thank you so much