@nake/babel-preset
Version:
Babel preset for transforming your future JS/JSX and TypeScript code
14 lines (10 loc) • 352 B
JavaScript
(async () => {
const response = await fetch(new URL('../hamsters.jpg', import.meta.url));
const blob = await response.blob();
const size = import.meta.scriptElement.dataset.size || 300;
const image = new Image();
image.src = URL.createObjectURL(blob);
image.width = size;
image.height = size;
document.body.appendChild(image);
})();