You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additionally, there is an official rollup plugin @rollup/plugin-esm-shim which adds __filename, __dirname, require support for ESM automatically, maybe it can be adapted as an esbuild plugin also.
The text was updated successfully, but these errors were encountered:
Additionally, there is an official rollup plugin @rollup/plugin-esm-shim which adds __filename, __dirname, require support for ESM automatically, maybe it can be adapted as an esbuild plugin also.
Out of scope, just curious: Why rollup uses require('u' + 'rl') instead of a direct require?
$echo'require("u" + "rl")'>a.js$npxrollupa.js-pcommonjsa.js→stdout...functioncommonjsRequire(path){thrownewError('Could not dynamically require "'+path+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');}vara={};commonjsRequire("u"+"rl");export{aasdefault};
Like rollup, it shims
import.meta.url
with the following codes:Additionally, there is an official rollup plugin
@rollup/plugin-esm-shim
which adds__filename
,__dirname
,require
support for ESM automatically, maybe it can be adapted as an esbuild plugin also.The text was updated successfully, but these errors were encountered: