wmr icon indicating copy to clipboard operation
wmr copied to clipboard

Support new URL('x', import.meta.url) in production

Open developit opened this issue 5 years ago • 0 comments

As discussed elsewhere, the following pattern is the only syntactically valid way to refer to external resources from JavaScript. As such, we should support this in order to allow npm modules to refer to non-JavaScript resources. I believe Webpack 5 has started supporting this too, so we're in good company.

const img = document.createElement('img');
img.src = new URL('./my-image.svg', import.meta.url);
document.body.appendChild(img);

developit avatar Dec 17 '20 15:12 developit