Closed
Description
Request Checklist:
- I have searched https://npmjs.com/ before opening this issue
- I have searched https://github.com/rollup/awesome before opening this issue
New Plugin Use Case
I would like to import code as a module from a data:{mime}
declaration.
import 'data:text/javascript, console.log('Buhhh')'
import me from 'data:application/json, { "my": 'json''}
import('data:application/json, { "my": 'json''})
New Plugin Proposal
Perhaps @rollup/plugin-data-mime
. The plugin could look like:
{
resolveId(id) {
if (isDataUrl(id)) {
return id;
}
return null;
},
load(id) {
if (isDataUrl(id)) {
return getCodeFromDataUrl(id);
}
return null;
}
}