3 ms·
>Why does import have to work with cjs? It doesn't in the browser. Why does require have to work esm? `import` doesn't have to work with cjs, but we want to do
by snek 8y ago
>Why does import have to work with cjs? It doesn't in the browser. Why does require have to work esm?
`import` doesn't have to work with cjs, but we want to do so because there is so much code in the ecosystem that is cjs.
`require` won't and can't work with esm, because esm resolution is async and require resolution is sync.
- ricardobeat 8y agoLet this be solved in userland through compilers, like everyone already does today. The stubbornness from current node maintainers on this subject is astounding. Years of feedback, like you see in this thread, ‘but-what-if’ and ‘you-dont-get-it’ handwaved away.