esm.sh
esm.sh copied to clipboard
Failed to import - @putout/plugin-putout?alias=putout:@putout/bundle
Failing module
- GitHub: https://github.com/coderaiser/putout
- npm: putout
import pluginPutout from 'https://esm.sh/@putout/plugin-putout?alias=putout:@putout/bundle';
Error message
After onload I got this:
Uncaught (in promise) Error: Dynamic require of "./apply-processors-destructuring" is not supported
Additional info
-
esm.sh version:
v87 -
Browser version:
Chrome v105
Would be great to have ability to support constructions like this:
const getRule = (a) => ({
[a]: require(`./${a}`),
});
module.exports.rules = {
...getRule('apply-async-formatter'),
};
const applyAsyncFormatter = require('./apply-async-formatter');
module.exports.rules = {
'apply-async-formatter': applyAsyncFormatter,
};
But that's much more code, repetition, and places to update when I'm adding a new rule. Webpack handles such cases easily, is it possible to add support of it to esm.sh somehow?