JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html>
<head>
<title>Script from URL Test</title>
</head>
<body>
<pre></pre>
<script type="module">
const results = document.querySelector('pre');
window.report = { message(x) { results.insertAdjacentHTML('beforeend', x + '\n'); } };
const script = document.createElement('script');
script.textContent = `
const blob = new Blob(['export default 1234;'], { type: 'application/javascript' });
const url = URL.createObjectURL(blob);
const m = 'import f from "' + url +'";'+ 'report.message(f);';
const url2 = URL.createObjectURL(new Blob([m], { type: 'application/javascript' }));
const script = document.createElement('script');
script.type = 'module';
script.src = url2;
document.body.appendChild(script);
`;
document.body.appendChild(script);
</script>
</body>
</html>