3 ms·
No one will use this Interoperability hack in light of the fact that Rollup and Webpack perform this for you seamlessly: import {createRequireFromPath as c
by shurley 8y ago
No one will use this Interoperability hack in light of the fact that Rollup and Webpack perform this for you seamlessly:
import {createRequireFromPath as createRequire} from 'module';
import {fileURLToPath as fromPath} from 'url';
const require = createRequire(fromPath(import.meta.url));
const cjsModule = require('./cjs-module.js');
Bundlers will not likely be able to produce efficient static code for that bizarre interop code.