Better HN
topnewbestaskshowjobs
Log inSign up

shurley

0 karma · joined Dec 26, 2018 (7y ago) · 1 submissions

Submissions

comment 7y ago · link · parent

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.